Adam Baker 201166301
Dependencies: mbed Gamepad N5110
BlockheadEngine/BlockheadEngine.h
- Committer:
- adambakerwa
- Date:
- 2019-05-08
- Revision:
- 43:11c5d098ce9d
- Parent:
- 42:0dad7c359fa5
- Child:
- 44:03059810630d
File content as of revision 43:11c5d098ce9d:
#ifndef BLOCKHEADENGINE_H #define BLOCKHEADENGINE_H #include "mbed.h" #include "Gamepad.h" #include "N5110.h" #include "Blockhead.h" #include "Levels.h" #include "Animation.h" /** BlockheadEngine Class * @brief Class for running the game * @author Adam P. Baker */ class BlockheadEngine { public: /** Constructor */ BlockheadEngine(); /** Deconstructor */ ~BlockheadEngine(); /** Initialises variables in blockhead class and level class and _pos struct. */ void init(); /** Intialises variables in blockhead class and level class and _pos struck (except level number which it keeps the same) */ void continueInit(); /** runs the game 'blockhead' *@param N5110 class which controlls lcd screen *@param Gamepad class for working with the gamepad *@returns _gameover (0 when blockhead alive, 1 once died) (int) */ int playgame(N5110 &lcd, Gamepad &pad); /** sets highscore if new highest level reached *@retunrs _highscore (int) */ int highscore(); private: Blockhead _blockhead; //blockhead class Levels _lev; //levels class Pos _pos; //_pos struct int _gameover; /**< _gameover flag (0 when alive, 1 onnce died) */ int _level; /**< what level blockhead is on */ int _highscore; /**< highest level reached */ }; #endif