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
Diff: Ball/Ball.h
- Revision:
- 10:6c6e09023942
- Parent:
- 9:a81db6a703b7
- Child:
- 11:f481ec642cc5
--- a/Ball/Ball.h Sun Apr 21 17:35:15 2019 +0000 +++ b/Ball/Ball.h Mon Apr 22 17:34:11 2019 +0000 @@ -18,23 +18,22 @@ ~Ball(); void init(int size,int speed); void draw(N5110 &lcd); - void update(); - /// accessors and mutators - void set_velocity(Vector2D v); - Vector2D get_velocity(); Vector2D get_pos(); void set_pos(Vector2D p); + + void update(); + /// accessors and mutators void start(N5110 &lcd,int checkHit, Direction dir); void get_direction(Gamepad &pad); - void set_field(N5110 &lcd); + void update_ball(int checkHit, Direction dir); int bowler_start(); - void draw_field(N5110 &lcd); void reset(); private: Gamepad pad; struct Fielder{ + Direction dir; int x; int y; int position; @@ -43,8 +42,6 @@ Bat bat; int ballHit; Vector2D _velocity; - Fielder field[5]; - int direction_set; Direction ball_direction; Direction _d; int bowled;