From 015cf96b313a689c91b1217a59a217e8ae8ccffb 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: Mon, 23 Sep 2019 15:35:44 +0300 Subject: [PATCH] Add files via upload --- FallSimulation.cpp | 86 +++++++++++++++++++++++++++++++++++++----- pictures/block.bmp | Bin 0 -> 10854 bytes pictures/question.bmp | Bin 0 -> 10854 bytes 3 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 pictures/block.bmp create mode 100644 pictures/question.bmp diff --git a/FallSimulation.cpp b/FallSimulation.cpp index e857987..78ebeac 100644 --- a/FallSimulation.cpp +++ b/FallSimulation.cpp @@ -9,8 +9,17 @@ int middleY; int extentX; int extentY; +struct Button { + RECT coords; + const char* text; + HDC picture; +}; + void background(COLORREF color); void drawMenu(); +void drawButton(Button but); +void loadingAnimation(int delay); +void mainFunc(); int main() { @@ -25,6 +34,9 @@ int main() txBegin(); + txSleep(50); + loadingAnimation(10); + txSleep(1000); drawMenu(); txEnd(); @@ -38,34 +50,60 @@ void background(COLORREF color) txClear(); } +void drawButton(Button but) +{ + //drawing button + txRectangle(but.coords.left, + but.coords.top, + but.coords.right, + but.coords.bottom); + + //drawing text + txDrawText (but.coords.left, + but.coords.top, + but.coords.right, + but.coords.bottom, + but.text); +} + void drawMenu() { - RECT buttonPlay { - middleX - 100, extentY / 3 - 50, - middleX + 100, extentY / 3 + 50 + //button "Play" + Button buttonPlay = { + { + middleX - 100, extentY / 3 - 50, + middleX + 100, extentY / 3 + 50 + }, "Play" }; - RECT buttonExit { - middleX - 100, extentY / 2 - 50, - middleX + 100, extentY / 2 + 50 + //button "Exit" + Button buttonExit = { + { + middleX - 100, extentY / 2 - 50, + middleX + 100, extentY / 2 + 50 + }, "Exit" }; txSetColor(TX_BLACK, 3); txSetFillColor(TX_WHITE); - txRectangle(buttonPlay.right, buttonPlay.top, buttonPlay.left, buttonPlay.bottom); - txRectangle(buttonExit.right, buttonExit.top, buttonExit.left, buttonExit.bottom); + drawButton(buttonPlay); + drawButton(buttonExit); + txSleep(50); while (!GetAsyncKeyState('Q')) { - if (In(txMousePos(), buttonPlay) && txMouseButtons() & 1) { + if (In(txMousePos(), buttonPlay.coords) && txMouseButtons() & 1) { while (txMouseButtons() & 1) { txSleep(10); } + loadingAnimation(18); + txSleep(50); + mainFunc(); txMessageBox("Запуск игры пока что не работает!", "Ошибка"); } - if (In(txMousePos(), buttonExit) && txMouseButtons() & 1) { + if (In(txMousePos(), buttonExit.coords) && txMouseButtons() & 1) { while (txMouseButtons() & 1) { txSleep(10); } @@ -75,3 +113,31 @@ void drawMenu() } } +void loadingAnimation(int delay) +{ + background(TX_WHITE); + + for (int circle_radius = 0; + circle_radius * circle_radius < extentX * extentX + extentY * extentY; + circle_radius += 3) { + + txSetColor(TX_BLACK, 2); + txSetFillColor(TX_BLACK); + + txCircle(0, 0, circle_radius); + + txSleep(delay); + } + + background(TX_WHITE); +} + +void mainFunc() +{ + HDC block = txLoadImage("pictures\\block.bmp"); + HDC quest = txLoadImage("pictures\\question.bmp"); + + txBitBlt(txDC(), extentX - 60, 0, 60, 60, block); + txBitBlt(txDC(), extentX - 60, 60, 60, 60, quest); +} + diff --git a/pictures/block.bmp b/pictures/block.bmp new file mode 100644 index 0000000000000000000000000000000000000000..288ab1c0ad60e5079fbb4d515aedd89c36adeed7 GIT binary patch literal 10854 zcmchddr(u^9mjXIQ4tf85Fi8yuOuW9Bh2Szj ze)GHM{O<35?)RSDb8c={*|(Tqqko0qjqtyc`+xm4HEp**|8HdYPaD8ZPEICdl*XkO zX$&RdTfDwVs#!WY`5!2Yf6?0I@w(Y5uGSUBB^OOjzK}?Cs_Y-6m-VEUbP_A=qMin& z;DrHhhVm)J`wdo)Bxlr;Y0R}`NhGnF!tLp0-LwwY=RH*BjwmQd0I0EmV<3$w#T{vt zgR&J@Q!Q)L%X%~Gt}JoBPt5U>c4>(N>@v-#v5WY{j*E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EvW5p`StD@ys!^L5sS92U?~iC#EPZHqIV192XVi;5#N_&*y#4R-CRcLVk=&-6*^Q%M7GfjB+%#~HWYrI^ z+xVf`FyT)WtQHbiAh<8WTv z$7_%Ob7#+$!mXdW1}7XRCY&cGTwo`8qp@RP;;rFF8;=b~Mr+`)G)7-lvg5aF&OEI< zIT73**9}rT37)2bN5j2n>=<~mZS>z8jtxgBV&J7fjJ~p}<4-OZMt@q@E@tb*WPw}QfNyH*}CWV!`G&J z#tO<5*N*->k*Xr&>Z959BU$S{2;VZ-TwU7sE9cO2sYu?8MJ#w!j^EF$06rNeiO7nm^D=lh z5l~!+1jTWaLBfkaazsEy&#l}*knf7Qi@rNX4C;{$z!)TI0&jjfeoj~(o9Yz_1RJSvBv8!>Fx`Y41g8G~ zGY4omb!&p_1-*FH@Swz#UjdOh#eZycnH}%)ml)*bKVqmM?#@(YgixF{@E%bvuIq2?d^Bh7+&Ob4DqVH*irw&7s;h*w ze&U&NoBez{^adEqfv)oY^zy?-=k--T`I|&in6|1f$31Ro_%M8fH!p>)A1&*DQc}06 zqUmjk#Av8Gp1XeB()eL;gGXl8i!ptOCXdpr9fFbU`WyLecdG~f1;3EA^?tQ!%)4ns z%tpPNf>`UQw{?u#I3J98TSmPdpL!>~-pNVylQn(cw%+!(jn9I$jCgzQk+S~-hpXz` literal 0 HcmV?d00001 diff --git a/pictures/question.bmp b/pictures/question.bmp new file mode 100644 index 0000000000000000000000000000000000000000..0a816bba381c4c3fc56b1b5121771570d062ad0d GIT binary patch literal 10854 zcmd5?3vg7`8NSKx-o20AfVAOZ5!)H-U~4V5)uN*V)Q*;^kEvx^3#g2uE!YP^Bvl3w zf+J$FLt#Y9qgv$=9uZWkD3B*)->;A?BtRhH84P>hkKIkS|G9T}vzy%w3v3*2zCAhj zJiq(j|NQ4a=iFaB_TmpP?YbAjvG98!{wu;pYU$%3zoA6`X$cU>m%E4E{TpoJjN*yU z8YVq!oHSzq7@$l7nZ=;Go|~GLni8+8^>W3+sf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