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
Diff: Ball/Ball.h
- Revision:
- 4:035448357749
- Parent:
- 3:a8960004d261
- Child:
- 5:0b31909caf7f
--- a/Ball/Ball.h Fri Mar 29 18:45:40 2019 +0000
+++ b/Ball/Ball.h Mon Apr 08 15:10:28 2019 +0000
@@ -12,14 +12,6 @@
* @date May, 2018
*/
-/** Joystick struct */
-struct Joystick {
- float x; /**< float for x value */
- float y; /**< float for y value */
- float mag; /**< float for magnitude */
-};
-
-
class Ball {
public:
@@ -34,29 +26,37 @@
void draw_ball(N5110 &lcd);
- void draw_aim(N5110 &lcd);
+ void draw_aim(N5110 &lcd, Gamepad &pad);
+
+ void draw_course(N5110 &lcd);
- void draw_screen(N5110 &lcd);
+ void draw_screen(N5110 &lcd, Gamepad &pad);
- void move_ball();
+ 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_hit_wall();
+ void check_bounce(N5110 &lcd);
void read_joy(Gamepad &pad);
private:
-
- Vector2D _coords;
- Joystick _joy;
+
+ Vector2D _joystick;
float _x_pos;
float _y_pos;
float _x_vel;
float _y_vel;
+ int _shot_count;
};
#endif
\ No newline at end of file