Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: GameEngine/GameEngine.h
- Revision:
- 11:ab578a151f67
- Parent:
- 8:dd1037c5435b
- Child:
- 13:12276eed13ac
--- a/GameEngine/GameEngine.h Wed Apr 22 20:02:22 2020 +0000 +++ b/GameEngine/GameEngine.h Thu Apr 23 18:17:28 2020 +0000 @@ -1,20 +1,20 @@ -#ifndef GAMEENIGNE_H -#define GAMEENIGNE_H +#ifndef GAMEENGINE_H +#define GAMEENGINE_H -// Include libraries +/////////////// Include libraries /////////////// #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Spaceship.h" #include "Map.h" + -/** Game Engine class +/** GameEngine class @brief Runs the different parts of the game @author Benjamin Evans, University of Leeds @date April 2020 */ - class GameEngine { public: /** Constructor */ @@ -24,7 +24,7 @@ ~GameEngine(); /** Initalises GameEngine - * @param lcd object, map object ,spaceship object, + * @param lcd object, map object ,spaceship object, pad objectn, adc object */ void init(N5110 &lcd, Spaceship &spaceship, Map &map, Gamepad &pad,AnalogIn &adc); @@ -32,14 +32,19 @@ * @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); - - /** Moves map with spaceship movment + + private: + /////////////// Functions /////////////// + + /** Moves map with spaceship movment * @param spaceship object, gampad object, */ void map_movement(Spaceship &spaceship, Gamepad &pad); - - private: - int move_map_; + + /////////////// Variables /////////////// + + // Changes the drawing x postion of map, 1 moves right, -1 moves left and 0 doesnt change map position + int move_map_; }; #endif \ No newline at end of file