Add files via upload

This commit is contained in:
CAHIH 2019-10-14 15:30:22 +03:00 committed by GitHub
parent 5c7306d5a8
commit dd8bfcac64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,6 +50,8 @@ void drawMenu();
void drawButton(Button but, bool picture); void drawButton(Button but, bool picture);
void loadingAnimation(int delay, int speed); void loadingAnimation(int delay, int speed);
void mainFunc(); void mainFunc();
bool checkClickBlock(RECT blockBut, bool clickedBlock);
void drawBlock(bool clickedfire , HDC fire );
int main() int main()
{ {
@ -122,7 +124,26 @@ void drawButton(Button but, bool picture)
but.text); but.text);
} }
bool checkClickBlock(RECT blockBut, bool clickedBlock)
{
if (In(txMousePos(), blockBut) && txMouseButtons() & 1) {
clickedBlock = true;
}
return clickedBlock;
}
void drawBlock(bool clickedfire, HDC fire)
{
if (txMouseButtons() & 1 && clickedfire) {
txBitBlt(txDC(), txMouseX() - 30, txMouseY() - 30, 60, 60, fire);
}
}
void drawMenu() void drawMenu()
{ {
//button "Play" //button "Play"
Button buttonPlay = { Button buttonPlay = {
@ -292,13 +313,8 @@ void mainFunc()
} }
//block "block" //block "block"
if (In(txMousePos(), blockBut) && txMouseButtons() & 1) { clickedBlock = checkClickBlock(blockBut, clickedBlock);
clickedBlock = true; drawBlock(clickedBlock, block);
}
if (txMouseButtons() & 1 && clickedBlock) {
txBitBlt(txDC(), txMouseX() - 30, txMouseY() - 30, 60, 60, block);
}
if (!(txMouseButtons() & 1) && clickedBlock) { if (!(txMouseButtons() & 1) && clickedBlock) {
if (arrElem < MAP_LENGHT) { if (arrElem < MAP_LENGHT) {
@ -321,12 +337,8 @@ void mainFunc()
} }
//block "quest" //block "quest"
if (In(txMousePos(), questBut) && txMouseButtons() & 1) { clickedQuest = checkClickBlock(questBut, clickedQuest);
clickedQuest = true; drawBlock (clickedQuest, quest);
}
if (txMouseButtons() & 1 && clickedQuest) {
txBitBlt(txDC(), txMouseX() - 30, txMouseY() - 30, 60, 60, quest);
}
if (!(txMouseButtons() & 1) && clickedQuest) { if (!(txMouseButtons() & 1) && clickedQuest) {
if (arrElem < MAP_LENGHT) { if (arrElem < MAP_LENGHT) {
@ -348,12 +360,8 @@ void mainFunc()
} }
//block "water" //block "water"
if (In(txMousePos(), waterBut) && txMouseButtons() & 1) { clickedWater = checkClickBlock(waterBut,clickedWater);
clickedWater = true; drawBlock (clickedWater,water);
}
if (txMouseButtons() & 1 && clickedWater) {
txBitBlt(txDC(), txMouseX() - 30, txMouseY() - 30, 60, 60, water);
}
if (!(txMouseButtons() & 1) && clickedWater) { if (!(txMouseButtons() & 1) && clickedWater) {
if (arrElem < MAP_LENGHT) { if (arrElem < MAP_LENGHT) {
@ -375,12 +383,8 @@ void mainFunc()
} }
//block "fire" //block "fire"
if (In(txMousePos(), fireBut) && txMouseButtons() & 1) { clickedfire = checkClickBlock (fireBut ,clickedfire);
clickedfire = true; drawBlock (clickedfire ,fire);
}
if (txMouseButtons() & 1 && clickedfire) {
txBitBlt(txDC(), txMouseX() - 30, txMouseY() - 30, 60, 60, fire);
}
if (!(txMouseButtons() & 1) && clickedfire) { if (!(txMouseButtons() & 1) && clickedfire) {
if (arrElem < MAP_LENGHT) { if (arrElem < MAP_LENGHT) {