From 9bbfac000037ac6f9fff0e6a3577c90730ca4f8a 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: Wed, 12 Feb 2020 13:16:04 +0300 Subject: [PATCH] Add files via upload --- main.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 7b26264..f6b41a7 100644 --- a/main.cpp +++ b/main.cpp @@ -125,6 +125,9 @@ int main() txDisableAutoPause(); } + else { + cout << "Wrong code!" << endl; + } return 0; } @@ -210,6 +213,9 @@ void gameLoop(string car1Adress, string car2Adress) if (soundInGame) { txPlaySound("music\\music.wav", SND_LOOP); } + else { + txPlaySound(NULL); + } int startTime = 3600 * tm->tm_hour + 60 * tm->tm_min + tm->tm_sec; for (int numberStar = 0; numberStar < 3; numberStar++) { @@ -633,7 +639,7 @@ Car moveCar(Car car, bool letters_mgmt) } } - car.fuel -= 0.50; + car.fuel -= 0.20; return car; } @@ -764,10 +770,16 @@ bool enterCode() fileWithCode.close(); - cout << "Enter the code" << endl; - cin >> code; + if (!(strcmp(codeFromFile, "") == 0)) { - return (strcmp(code, codeFromFile) == 0); + cout << "Enter the code" << endl; + cin >> code; + + return (strcmp(code, codeFromFile) == 0); + } + else { + return true; + } } void selectingCars(HDC* cars)