ELEC2645 (2018/19) / Mbed 2 deprecated el17dg

Dependencies:   mbed

Fork of el17dg by Dmitrijs Griskovs

Revision:
32:5403bb974294
Parent:
31:becb8f6bf7b7
Child:
33:c623c6d5ed16
--- a/game/enemies.h	Tue Apr 23 18:18:57 2019 +0000
+++ b/game/enemies.h	Fri Apr 26 13:09:03 2019 +0000
@@ -62,10 +62,10 @@
         if (GameGlobals::game_score >= 200){
             if (switch_enemy_y_dir == false){pos.y -= 1;}
             else if(switch_enemy_y_dir == true){pos.y += 1;}
-            if (pos.y > (game_area_height - enemy2_height)){
+            if (pos.y >= (game_area_height - enemy2_height)){
                 switch_enemy_y_dir = false;
             }
-            else if (pos.y < game_area_y){
+            else if (pos.y <= game_area_y){
                 switch_enemy_y_dir = true;   
             }
         }