2035 project 2
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
Diff: main.cpp
- Revision:
- 23:06cbe894690d
- Parent:
- 22:397601b1cdb4
--- a/main.cpp Wed Dec 01 23:28:39 2021 +0000 +++ b/main.cpp Wed Dec 01 23:39:02 2021 +0000 @@ -775,13 +775,17 @@ } void youLoseScreen() { - uLCD.background_color(0xFFFF00); + uLCD.background_color(0xFF0000); uLCD.cls(); uLCD.locate(2,2); - uLCD.printf("YOU LOSE, try again!"); + + uLCD.printf("YOU LOSE"); + uLCD.locate(2,5); + uLCD.printf("Try Again!"); } void decreaseLife() { + if(Player.lives >1){ maps_init(); init_main_map(); init_boss_map(); @@ -795,6 +799,8 @@ Player.has_key = false; Player.health = 99; Player.lives--; + } + } /** * Program entry point! This is where it all begins. @@ -897,6 +903,7 @@ if(Player.lives == 1) { doesGameContinue = 0; youLoseScreen(); + break; } else { decreaseLife(); }