Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed FATFileSystem
Ball/Ball.h
- Committer:
- ellisbhastroud
- Date:
- 2019-04-08
- Revision:
- 4:035448357749
- Parent:
- 3:a8960004d261
- Child:
- 5:0b31909caf7f
File content as of revision 4:035448357749:
#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 draw_ball(N5110 &lcd);
void draw_aim(N5110 &lcd, Gamepad &pad);
void draw_course(N5110 &lcd);
void draw_screen(N5110 &lcd, Gamepad &pad);
void move_ball(int frame_rate, N5110 &lcd);
Vector2D get_ball_pos();
void shoot_ball(Gamepad &pad);
int get_shot_count();
void print_shot_count(N5110 &lcd);
void set_vel(float x_vel, float y_vel);
void check_bounce(N5110 &lcd);
void read_joy(Gamepad &pad);
private:
Vector2D _joystick;
float _x_pos;
float _y_pos;
float _x_vel;
float _y_vel;
int _shot_count;
};
#endif