ELEC2645 (2018/19) / Mbed 2 deprecated el17ebs

Dependencies:   mbed FATFileSystem

Ball/Ball.h

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

File content as of revision 5:0b31909caf7f:

#ifndef BALL_H
#define BALL_H

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

/** Ball Class
* @brief Class for controlling the golf ball
* @author Ellis Blackford Stroud
* @date May, 2018
*/

class Ball 
{

public:

    /** Constructor */
    Ball();

    /** Destructor */
    ~Ball();
    
    void init(float x_pos, float y_pos);
    
    void drawBall(N5110 &lcd);
    
    void printShotCount(N5110 &lcd);
    
    void drawPower(N5110 &lcd, Gamepad &pad);
                    
    void move_ball(int frame_rate);
    
    Vector2D get_ball_pos();
    
    void shoot_ball(Gamepad &pad);
    
    int get_shot_count();
        
    void set_vel(float x_vel, float y_vel);

    void read_joy(Gamepad &pad);
    
    void check_wall_bounce();
    
    
private:

    
    Vector2D _joystick;
    float _mag;
    float _x_pos; 
    float _y_pos;
    float _x_vel;
    float _y_vel;
    int _shot_count;
    Direction _direction;
};  

#endif