Matis Requis 201241242

Dependencies:   mbed

Tempest Game

Game Screen

https://os.mbed.com/media/uploads/MatisRequis/tempest_board_wiki.png The board is made of 12 columns. The Hero stays at the top of the column

Game Controls

https://os.mbed.com/media/uploads/MatisRequis/gamepad_buttons.png

To control the hero spaceship point the joystick to the column you want the hero to go to.

Press the A button to shoot a bullet in the column you are currently in.

Hero/Hero.h

Committer:
MatisRequis
Date:
2020-05-26
Revision:
10:2ae9d4145410
Parent:
6:037dfa5064a1

File content as of revision 10:2ae9d4145410:

#ifndef HERO_H
#define HERO_H

// Included Libraries
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"


/** Hero Class
 * @brief Draws and moves the hero
 * @author Matis Requis
 * @date May, 2020
 */
class Hero {
    
public:
    /** Constructor */
    Hero();
    
    /** Destructor */
    ~Hero();
    
    /** Initialises the hero
     * @param column @details the column the hero is going to spawn at
     */
    void init(int column);
    
    /** Draws the hero spaceship
     * @param lcd @details N5110 object
     */
    void draw(N5110 &lcd);
    
    /** Update spaceship position depending on joystick input
     * @param d @details Direction of joystick
     */
    void update(float d);
    
    /** Gets the current position of the hero
     * @return hero_pos @details returns Vector2D structure with xy position
     */
    Vector2D getxy();
    
    /** Gets the current column of the hero
     * @return _column @details returns the current column
     */
    int get_column();
    
private:
    
    
    int _x;
    int _y;
    int _d;
    int _column;
    
};
#endif