2035 project 2

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Files at this revision

API Documentation at this revision

Comitter:
ranroun3
Date:
Wed Dec 01 23:39:02 2021 +0000
Parent:
22:397601b1cdb4
Commit message:
FINAL p2-2;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- 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();
             }