From 2f0fa6a595be7c73d1d4becea6b7783c945615c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9?= <50486086+DarkCat09@users.noreply.github.com> Date: Fri, 29 Nov 2019 16:32:09 +0400 Subject: [PATCH] Add files via upload Edited main.cpp --- FallSimulation.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/FallSimulation.cpp b/FallSimulation.cpp index de22492..a307b0d 100644 --- a/FallSimulation.cpp +++ b/FallSimulation.cpp @@ -177,7 +177,7 @@ void drawMenu() txSleep(50); bool flwindow = false; - while (!GetAsyncKeyState('Q')) { + while (!GetAsyncKeyState('Q') || !GetAsyncKeyState(VK_ESCAPE)) { if (!gameIsStarted) { if (In(txMousePos(), buttonStart.coords) && txMouseButtons() & 1) { while (txMouseButtons() & 1) { @@ -196,8 +196,8 @@ void drawMenu() break; } - if (In(txMousePos(), buttonHelp.coords)) - { + if (In(txMousePos(), buttonHelp.coords)) { + txSetColor(TX_BLACK); txDrawText(buttonHelp.coords.left - 130, buttonHelp.coords.bottom + 10, @@ -205,8 +205,7 @@ void drawMenu() buttonHelp.coords.bottom + 100, "This hyperlink will be\nopen in browser"); } - else - { + else { txSetColor(TX_WHITE); txSetFillColor(TX_WHITE); txRectangle(buttonHelp.coords.left - 130, @@ -220,7 +219,7 @@ void drawMenu() txSleep(10); } - system("start help\\help.html"); + system("start help\\index.html"); } /* if (In(txMousePos(), buttonPlay.coords) && txMouseButtons() & 1) { @@ -334,6 +333,8 @@ void mainFunc() MapPart mapParts[MAP_LENGHT + 1]; + txSetColor(TX_BLACK, 3); + txSetFillColor(TX_WHITE); Button completeButton = {doneBut, "\n\nSave\n\nFile"}; for (int elem = 0; elem < MAP_LENGHT; elem++) { @@ -384,6 +385,23 @@ void mainFunc() clickedWater = addingBlock(clickedWater, waterBut, water, WATER_TYPE, &arrElem, mapParts); clickedFire = addingBlock(clickedFire, fireBut, fire, FIRE_TYPE, &arrElem, mapParts); + //checking + if (clickedBlock) + { + clickedQuest = false; + clickedWater = false; + clickedFire = false; + } + else if (clickedQuest) + { + clickedWater = false; + clickedFire = false; + } + else if (clickedWater) + { + clickedFire = false; + } + //selecting block for (int i = 0; i < arrElem; i++) { if (selectedPict < 0 &&