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
Bat/Bat.h@14:122eaa3b7a50, 2019-04-23 (annotated)
- Committer:
- shahidsajid
- Date:
- Tue Apr 23 20:57:15 2019 +0000
- Revision:
- 14:122eaa3b7a50
- Parent:
- 13:924891519a95
- Child:
- 15:81a3aaf52647
Completed update_game(); Game now runs multiple times with field changed each time;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| shahidsajid | 4:55a0509c4874 | 1 | #ifndef BAT_H |
| shahidsajid | 4:55a0509c4874 | 2 | #define BAT_H |
| shahidsajid | 4:55a0509c4874 | 3 | |
| shahidsajid | 4:55a0509c4874 | 4 | #include "mbed.h" |
| shahidsajid | 4:55a0509c4874 | 5 | #include "N5110.h" |
| shahidsajid | 4:55a0509c4874 | 6 | #include "Gamepad.h" |
| shahidsajid | 4:55a0509c4874 | 7 | |
| shahidsajid | 4:55a0509c4874 | 8 | /** Ball Class |
| shahidsajid | 4:55a0509c4874 | 9 | @author Dr Craig A. Evans, University of Leeds |
| shahidsajid | 4:55a0509c4874 | 10 | @brief Controls the ball in the Pong game |
| shahidsajid | 4:55a0509c4874 | 11 | @date Febraury 2017 |
| shahidsajid | 4:55a0509c4874 | 12 | */ |
| shahidsajid | 4:55a0509c4874 | 13 | class Bat |
| shahidsajid | 4:55a0509c4874 | 14 | { |
| shahidsajid | 4:55a0509c4874 | 15 | |
| shahidsajid | 4:55a0509c4874 | 16 | public: |
| shahidsajid | 4:55a0509c4874 | 17 | Bat(); |
| shahidsajid | 4:55a0509c4874 | 18 | ~Bat(); |
| shahidsajid | 4:55a0509c4874 | 19 | void init(int x,int y); |
| shahidsajid | 4:55a0509c4874 | 20 | void draw(N5110 &lcd); |
| shahidsajid | 4:55a0509c4874 | 21 | void update(); |
| shahidsajid | 6:3e50f2cf4366 | 22 | int get_hitBall(); |
| shahidsajid | 13:924891519a95 | 23 | void reset(); |
| shahidsajid | 13:924891519a95 | 24 | int get_loft_ball(); |
| shahidsajid | 4:55a0509c4874 | 25 | /// accessors and mutators |
| shahidsajid | 14:122eaa3b7a50 | 26 | |
| shahidsajid | 4:55a0509c4874 | 27 | |
| shahidsajid | 4:55a0509c4874 | 28 | private: |
| shahidsajid | 14:122eaa3b7a50 | 29 | |
| shahidsajid | 14:122eaa3b7a50 | 30 | |
| shahidsajid | 6:3e50f2cf4366 | 31 | Gamepad batPad; |
| shahidsajid | 6:3e50f2cf4366 | 32 | int _hitBall; |
| shahidsajid | 13:924891519a95 | 33 | int _loft_ball; |
| shahidsajid | 4:55a0509c4874 | 34 | int d; |
| shahidsajid | 6:3e50f2cf4366 | 35 | Direction _d; |
| shahidsajid | 4:55a0509c4874 | 36 | int _size; |
| shahidsajid | 4:55a0509c4874 | 37 | int _x; |
| shahidsajid | 4:55a0509c4874 | 38 | int _y; |
| shahidsajid | 4:55a0509c4874 | 39 | }; |
| shahidsajid | 4:55a0509c4874 | 40 | #endif |