Adam Baker 201166301

Dependencies:   mbed Gamepad N5110

BlockheadEngine/BlockheadEngine.h

Committer:
adambakerwa
Date:
2019-05-08
Revision:
42:0dad7c359fa5
Parent:
41:4b20f909bbcb
Child:
43:11c5d098ce9d

File content as of revision 42:0dad7c359fa5:

#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:
    /**
    *@brief Constructor
    */
    BlockheadEngine();
    
    /**
    *@brief Deconstructor
    */
    ~BlockheadEngine();
    
    /**
    *@brief Initialises variables in blockhead class and level class and _pos struct.
    */
    void init();
    
    /**
    *@brief Intialises variables in blockhead class and level class and _pos struck (except level number which it keeps the same)
    */
    void continueInit();
    
    /**
    *@brief runs the game 'blockhead'
    *@param lcd @brief class which controlls lcd screen
    *@param pad @brief class for working with the gamepad 
    *@returns _gameover @brief (0 when blockhead alive, 1 once died)
    */
    int playgame(N5110 &lcd, Gamepad &pad);
    
    /**
    *@bried sets highscore if new highest level reached
    *@retunrs _highscore
    */
    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