Initial publish

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Revision:
36:207ec7db8648
Parent:
35:172db1608332
Child:
37:6a2bf4488022
--- a/game/game.cpp	Tue Apr 30 20:51:39 2019 +0000
+++ b/game/game.cpp	Thu May 02 13:35:22 2019 +0000
@@ -102,7 +102,9 @@
   */
 bool Game::updateAndDraw() {
     if (game_state == GameState_newgame) {
-        //printf("start game \n");
+        #ifdef DEBUGel17dg
+        printf("start game \n");
+        #endif
         startNewGame();
     }
     if (game_state == GameState_gameplay) { updateAndDrawGameplay(); }
@@ -140,7 +142,9 @@
                 );
                 if (collision) {
                     enemy.die();
-                    //printf("enemy got hit and dies from blast");
+                    #ifdef DEBUGel17dg
+                    printf("enemy got hit and dies");
+                    #endif
                     GameGlobals::game_score += 30;
                     GameGlobals::score_count_for_difficulty +=30;
                     GameGlobals::score_count_for_boss_mode += 30;
@@ -170,7 +174,9 @@
                 if (!GameGlobals::is_shield_on){
                     gamepad.tone(423,0.4); 
                     GameGlobals::player_lifes -= 1;
-                    //printf("lost a life from blast. left: %i \n", GameGlobals::player_lifes);
+                    #ifdef DEBUGel17dg
+                    printf("lost a life from blast. left: %i \n", GameGlobals::player_lifes);
+                    #endif
                     blast.active = false;
                 }else{
                     blast.active = false;
@@ -195,9 +201,12 @@
             );
             if (collision) {
                 GameGlobals::player_lifes -= 1;
-                //printf("lost a life from enemy col. left: %i \n", GameGlobals::player_lifes);
+               
                 enemy.die();
-                //printf("enemy got hit from collsion and dies");
+                #ifdef DEBUGel17dg
+                printf("enemy got hit from collsion and dies");
+                printf("lost a life from enemy col. left: %i \n", GameGlobals::player_lifes);
+                #endif
             }
         }
     } 
@@ -291,6 +300,7 @@
      for (int i = 0; i < boss.max_boss_blasts; ++i) {
         boss.boss_blasts[i].active = false;
     }
+    gamepad.check_event(gamepad.START_PRESSED);
 }
 
 /**