Initial publish

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Revision:
25:749f1efc31fc
Parent:
23:240bc00ef25b
Child:
26:676874c42883
--- a/game/player.h	Tue Apr 02 15:38:40 2019 +0000
+++ b/game/player.h	Wed Apr 03 12:46:04 2019 +0000
@@ -2,6 +2,7 @@
 #define PLAYER_H
 
 #include "constants.h"
+#include "game.h"
 
 const int max_player_blasts = 5;
 const int ship_speed = 2;
@@ -34,6 +35,7 @@
                 blasts[i].pos.x += blast_speed;
                 if (blasts[i].pos.x >= screen_width){
                     blasts[i].active = false;
+                    game_score -= 10;
                 }
                 lcd.setPixel(blasts[i].pos.x,   blasts[i].pos.y, 1);
                 lcd.setPixel(blasts[i].pos.x+1, blasts[i].pos.y, 1);
@@ -89,12 +91,6 @@
         int max_player_y = game_area_y + game_area_height - spaceship1_height;
         if (player.pos.x > max_player_x) player.pos.x = max_player_x;
         if (player.pos.y > max_player_y) player.pos.y = max_player_y;
-}
-    
-    
-    
-    
+    }  
 };
-
-
 #endif
\ No newline at end of file