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)