ELEC2645 (2018/19) / Mbed 2 deprecated el17ebs

Dependencies:   mbed FATFileSystem

Committer:
ellisbhastroud
Date:
Mon Apr 08 15:10:28 2019 +0000
Revision:
4:035448357749
Parent:
3:a8960004d261
Child:
5:0b31909caf7f
Settings section of menu fully functioning.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ellisbhastroud 3:a8960004d261 1 #ifndef BALL_H
ellisbhastroud 3:a8960004d261 2 #define BALL_H
ellisbhastroud 3:a8960004d261 3
ellisbhastroud 3:a8960004d261 4 #include "mbed.h"
ellisbhastroud 3:a8960004d261 5 #include "N5110.h"
ellisbhastroud 3:a8960004d261 6 #include "Gamepad.h"
ellisbhastroud 3:a8960004d261 7
ellisbhastroud 3:a8960004d261 8
ellisbhastroud 3:a8960004d261 9 /** Ball Class
ellisbhastroud 3:a8960004d261 10 * @brief Class for controlling the golf ball
ellisbhastroud 3:a8960004d261 11 * @author Ellis Blackford Stroud
ellisbhastroud 3:a8960004d261 12 * @date May, 2018
ellisbhastroud 3:a8960004d261 13 */
ellisbhastroud 3:a8960004d261 14
ellisbhastroud 3:a8960004d261 15 class Ball {
ellisbhastroud 3:a8960004d261 16
ellisbhastroud 3:a8960004d261 17 public:
ellisbhastroud 3:a8960004d261 18
ellisbhastroud 3:a8960004d261 19 /** Constructor */
ellisbhastroud 3:a8960004d261 20 Ball();
ellisbhastroud 3:a8960004d261 21
ellisbhastroud 3:a8960004d261 22 /** Destructor */
ellisbhastroud 3:a8960004d261 23 ~Ball();
ellisbhastroud 3:a8960004d261 24
ellisbhastroud 3:a8960004d261 25 void init(float x_pos, float y_pos);
ellisbhastroud 3:a8960004d261 26
ellisbhastroud 3:a8960004d261 27 void draw_ball(N5110 &lcd);
ellisbhastroud 3:a8960004d261 28
ellisbhastroud 4:035448357749 29 void draw_aim(N5110 &lcd, Gamepad &pad);
ellisbhastroud 4:035448357749 30
ellisbhastroud 4:035448357749 31 void draw_course(N5110 &lcd);
ellisbhastroud 3:a8960004d261 32
ellisbhastroud 4:035448357749 33 void draw_screen(N5110 &lcd, Gamepad &pad);
ellisbhastroud 3:a8960004d261 34
ellisbhastroud 4:035448357749 35 void move_ball(int frame_rate, N5110 &lcd);
ellisbhastroud 4:035448357749 36
ellisbhastroud 4:035448357749 37 Vector2D get_ball_pos();
ellisbhastroud 3:a8960004d261 38
ellisbhastroud 3:a8960004d261 39 void shoot_ball(Gamepad &pad);
ellisbhastroud 3:a8960004d261 40
ellisbhastroud 4:035448357749 41 int get_shot_count();
ellisbhastroud 4:035448357749 42
ellisbhastroud 4:035448357749 43 void print_shot_count(N5110 &lcd);
ellisbhastroud 4:035448357749 44
ellisbhastroud 3:a8960004d261 45 void set_vel(float x_vel, float y_vel);
ellisbhastroud 3:a8960004d261 46
ellisbhastroud 4:035448357749 47 void check_bounce(N5110 &lcd);
ellisbhastroud 3:a8960004d261 48
ellisbhastroud 3:a8960004d261 49 void read_joy(Gamepad &pad);
ellisbhastroud 3:a8960004d261 50
ellisbhastroud 3:a8960004d261 51 private:
ellisbhastroud 3:a8960004d261 52
ellisbhastroud 4:035448357749 53
ellisbhastroud 4:035448357749 54 Vector2D _joystick;
ellisbhastroud 3:a8960004d261 55 float _x_pos;
ellisbhastroud 3:a8960004d261 56 float _y_pos;
ellisbhastroud 3:a8960004d261 57 float _x_vel;
ellisbhastroud 3:a8960004d261 58 float _y_vel;
ellisbhastroud 4:035448357749 59 int _shot_count;
ellisbhastroud 3:a8960004d261 60 };
ellisbhastroud 3:a8960004d261 61
ellisbhastroud 3:a8960004d261 62 #endif