Ben Evans / Mbed 2 deprecated Defender_Game

Dependencies:   mbed

GameEngine/GameEngine.h

Committer:
evanso
Date:
2020-04-26
Revision:
14:7419c680656f
Parent:
13:12276eed13ac
Child:
15:90b6821bcf64

File content as of revision 14:7419c680656f:

#ifndef GAMEENGINE_H
#define GAMEENGINE_H
 
// Include libraries -----------------------------------------------------------
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Spaceship.h"
#include "Map.h"

 
/** GameEngine class
@brief Runs the different parts of the game 
@author Benjamin Evans, University of Leeds
@date April 2020
*/

class GameEngine {
    public:
        /** Constructor */
        GameEngine();
        
        /** Destructor */
        ~GameEngine();
        
        /** Initalises GameEngine */
        void init();
        
        /** Main gameplay loop that runs playable part of game */
        void gameplay_loop();
          
    private:
        // Function prototypes -------------------------------------------------
    
       /** Moves map with spaceship movment */
        void 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();
        
        // Objects -------------------------------------------------------------
    
        // Gamepad object 
        Gamepad pad;
        
        // LCD object
        N5110 lcd;
      
        // Direction object of joystick
        Direction d_; 
        
        // Spaceship object 
        Spaceship spaceship;
        
        // Map object 
        Map map;  
};
 
#endif