1
- #define _CRT_SECURE_NO_WARNINGS 1
1
+ #define _CRT_SECURE_NO_WARNINGS 1
2
2
#include < iostream>
3
3
#include < windows.h>
4
4
#include < string.h>
5
5
#include < cstdio>
6
6
#include < cstdlib>
7
7
#include < conio.h>
8
8
#include < time.h>
9
+ #include " MMSystem.h"
10
+ using namespace std ;
9
11
10
12
#define MAX 8
11
13
@@ -261,7 +263,7 @@ int nactiHraciPoleZeSouboru()
261
263
262
264
int sloupec, radek, znak;
263
265
264
- FILE * soubor;
266
+ FILE* soubor;
265
267
if (mapSettings == 1 )
266
268
{
267
269
if (soubor = fopen (" maps\\ 01.txt" , " r" ))
@@ -332,13 +334,13 @@ int main()
332
334
333
335
setTextColor (35 );
334
336
std::cout << " _______ _ _____ _ _ _____ \n "
335
- " |__ __| | / ____| | | (_) / ____| \n "
336
- " | | | |__ ___ | (___ __ _ ___| |__ _____ ___ __ _ ___ ___ | | __ __ _ _ __ ___ ___ \n "
337
- " | | | '_ \\ / _ \\ \\ ___ \\ / _` |/ __| '_ \\ / _ \\ \\ / / '_ \\ | |/ __/ _ \\ | | |_ |/ _` | '_ ` _ \\ / _ \\\n "
338
- " | | | | | | __/ ____) | (_| | (__| | | | (_) \\ V /| | | | | (_| __/ | |__| | (_| | | | | | | __/\n "
339
- " |_| |_| |_|\\ ___| |_____/ \\ __,_|\\ ___|_| |_|\\ ___/ \\ _/ |_| |_|_|\\ ___\\ ___| \\ _____|\\ __,_|_| |_| |_|\\ ___|\n " ;
337
+ " |__ __| | / ____| | | (_) / ____| \n "
338
+ " | | | |__ ___ | (___ __ _ ___| |__ _____ ___ __ _ ___ ___ | | __ __ _ _ __ ___ ___ \n "
339
+ " | | | '_ \\ / _ \\ \\ ___ \\ / _` |/ __| '_ \\ / _ \\ \\ / / '_ \\ | |/ __/ _ \\ | | |_ |/ _` | '_ ` _ \\ / _ \\\n "
340
+ " | | | | | | __/ ____) | (_| | (__| | | | (_) \\ V /| | | | | (_| __/ | |__| | (_| | | | | | | __/\n "
341
+ " |_| |_| |_|\\ ___| |_____/ \\ __,_|\\ ___|_| |_|\\ ___/ \\ _/ |_| |_|_|\\ ___\\ ___| \\ _____|\\ __,_|_| |_| |_|\\ ___|\n " ;
340
342
setTextColor (33 );
341
- printf (" version: 4.3 .0\n " );
343
+ printf (" version: 4.4 .0\n " );
342
344
setTextColor (37 );
343
345
printf (" \n\n " );
344
346
printf (" Pro spusteni hry stiskni klavesu" );
@@ -365,11 +367,11 @@ int main()
365
367
printf (" ESC" );
366
368
setTextColor (37 );
367
369
printf (" !\n " );
368
-
369
370
menuCheck ();
370
371
371
372
if (menuActive == 1 )
372
373
{
374
+
373
375
if (!nactiHraciPoleZeSouboru ())
374
376
{
375
377
setTextColor (41 );
@@ -446,12 +448,15 @@ int main()
446
448
447
449
if (poziceX == positionOfEndX && poziceY == positionOfEndY)
448
450
{
451
+
449
452
setTextColor (33 );
450
453
printf (" ----------------------------------------------\n " );
451
454
printf (" Gratuluji ti, kavalire! Mas u me svacinu!\n " );
452
455
printf (" ----------------------------------------------\n " );
453
456
setTextColor (37 );
457
+ PlaySound (TEXT (" sounds\\ win.wav" ), NULL , SND_SYNC);
454
458
exit (0 );
459
+
455
460
}
456
461
else if (znak == 27 )
457
462
{
@@ -460,6 +465,7 @@ int main()
460
465
printf (" Ukoncil jsi hru, srabe!\n " );
461
466
printf (" ----------------------------------------------\n " );
462
467
setTextColor (37 );
468
+ PlaySound (TEXT (" sounds\\ lose.wav" ), NULL , SND_SYNC);
463
469
exit (0 );
464
470
}
465
471
else if ((casAktualni - casSpusteniHry) == CASKONCE)
@@ -469,6 +475,7 @@ int main()
469
475
printf (" Vyprsel ti cas!\n " );
470
476
printf (" ----------------------------------------------\n " );
471
477
setTextColor (37 );
478
+ PlaySound (TEXT (" sounds\\ lose.wav" ), NULL , SND_SYNC);
472
479
exit (0 );
473
480
}
474
481
else
@@ -478,6 +485,7 @@ int main()
478
485
printf (" Umrel jsi :(\n " );
479
486
printf (" ----------------------------------------------\n " );
480
487
setTextColor (37 );
488
+ PlaySound (TEXT (" sounds\\ lose.wav" ), NULL , SND_SYNC);
481
489
exit (0 );
482
490
}
483
491
}
0 commit comments