ELEC2645 (2018/19) / Mbed 2 deprecated el17ebs

Dependencies:   mbed FATFileSystem

GolfEngine/GolfEngine.h

Committer:
ellisbhastroud
Date:
2019-04-17
Revision:
5:0b31909caf7f
Child:
8:d410856c6d04

File content as of revision 5:0b31909caf7f:

#ifndef GOLFENGINE_H
#define GOLFENGINE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Ball.h"

/** Golf Engine Class
* @brief Library to run golf game
* @author Ellis Blackford Stroud
* @date May, 2018
*/

/** Enum for wall types */
enum Wall {
    
    LEFT,  /**< left wall */
    RIGHT,       /**< right wall */
    TOP,      /**< top wall */
    BOTTOM,       /**< bottom wall */
};

/** Course Information struct */
struct Course {
    Wall wall;  /**< wall type */
    Vector2D start; /**< coordinate of line start */
    Vector2D end; /**< coordinate of line end */
};

class GolfEngine 
{

public:

    /** Constructor */
    GolfEngine();

    /** Destructor */
    ~GolfEngine();
    
    void init();
    
    void drawGame(N5110 &lcd);
    
    void update_ball(Gamepad &pad, int frame_rate);
    
    void drawCourseWalls(N5110 &lcd);
    
    void check_wall_bounce();

private:

    int _x_pos;
    int _y_pos;

    Ball _ball;
    
    //Srtuct array to store coords of lines to plot for first level, this data also used in bounce algorithm

    Course _level_1[6];
};

#endif