Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

Revision:
13:12276eed13ac
Parent:
11:ab578a151f67
Child:
14:7419c680656f
--- a/GameEngine/GameEngine.h	Fri Apr 24 19:09:22 2020 +0000
+++ b/GameEngine/GameEngine.h	Sun Apr 26 17:08:10 2020 +0000
@@ -1,7 +1,7 @@
 #ifndef GAMEENGINE_H
 #define GAMEENGINE_H
  
-/////////////// Include libraries ///////////////
+// Include libraries -----------------------------------------------------------
 #include "mbed.h"
 #include "N5110.h"
 #include "Gamepad.h"
@@ -26,25 +26,44 @@
         /** Initalises GameEngine 
         * @param lcd object, map object ,spaceship object, pad objectn, adc object
         */
-        void init(N5110 &lcd, Spaceship &spaceship, Map &map, Gamepad &pad,AnalogIn &adc);
+        void init();
         
         /** Main gameplay loop that runs playable part of game
         * @param lcd object, map object ,spaceship object, potentiometer object, pad object, potentiometer object
         */
-        void gameplay_loop(N5110 &lcd, Spaceship &spaceship, Map &map, Gamepad &pad, AnalogIn &pot_1);
+        void gameplay_loop();
           
     private:
-    /////////////// Functions ///////////////
+        // Function prototypes -------------------------------------------------
     
        /** Moves map with spaceship movment
-        * @param spaceship object, gampad object, 
+        * @param spaceship object, gampad object, Direction f
         */
-        void map_movement(Spaceship &spaceship, Gamepad &pad);
+        void map_movement();
     
-    /////////////// Variables ///////////////
+        // 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();
+        
+        // Objects -------------------------------------------------------------
+    
+        // Gamepad object 
+        Gamepad pad;
+        
+        // LCD object
+        N5110 lcd;
+      
+        // Direction object of joystick
+        Direction d_; 
+        
+        // Spaceship object 
+        Spaceship spaceship;
+        
+        // Map object 
+        Map map;  
 };
  
 #endif
\ No newline at end of file