Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Revision:
15:90b6821bcf64
Parent:
14:7419c680656f
Child:
16:1ee3d3804557
--- a/GameEngine/GameEngine.h	Sun Apr 26 20:31:53 2020 +0000
+++ b/GameEngine/GameEngine.h	Tue Apr 28 19:13:12 2020 +0000
@@ -1,7 +1,7 @@
 #ifndef GAMEENGINE_H
 #define GAMEENGINE_H
  
-// Include libraries -----------------------------------------------------------
+// Included libraries -----------------------------------------------------------
 #include "mbed.h"
 #include "N5110.h"
 #include "Gamepad.h"
@@ -28,20 +28,27 @@
         
         /** Main gameplay loop that runs playable part of game */
         void gameplay_loop();
+        
+        /** Gets joystick direction from gamepad and stores it in d_*/
+        void read_joystick_direction();
+        
+        
+        // Accessors and mutators ----------------------------------------------
           
     private:
         // Function prototypes -------------------------------------------------
     
-       /** Moves map with spaceship movment */
-        void map_movement();
+        /** Calulates the map movement depeding on spaceship positions and joystick input */
+        void calculate_map_movement();
     
         // Variables -----------------------------------------------------------
         
         // Changes the drawing x postion of map, 1 moves right, -1 moves left and 0 doesnt change map position 
         int move_map_;
         
-        void get_joystick_direction();
-        
+        // Direction of joystick
+        Direction d_; 
+    
         // Objects -------------------------------------------------------------
     
         // Gamepad object 
@@ -49,9 +56,6 @@
         
         // LCD object
         N5110 lcd;
-      
-        // Direction object of joystick
-        Direction d_; 
         
         // Spaceship object 
         Spaceship spaceship;