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@21:a0904159e183, 2019-04-30 (annotated)
- Committer:
- shahidsajid
- Date:
- Tue Apr 30 13:17:14 2019 +0000
- Revision:
- 21:a0904159e183
- Parent:
- 20:9d21599fe350
- Child:
- 26:6427f09cf8d3
Created text for the rules and controls menus;
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 | 21:a0904159e183 | 7 | #include "UX.h" |
| shahidsajid | 4:55a0509c4874 | 8 | |
| shahidsajid | 4:55a0509c4874 | 9 | /** Ball Class |
| shahidsajid | 4:55a0509c4874 | 10 | @author Dr Craig A. Evans, University of Leeds |
| shahidsajid | 4:55a0509c4874 | 11 | @brief Controls the ball in the Pong game |
| shahidsajid | 4:55a0509c4874 | 12 | @date Febraury 2017 |
| shahidsajid | 4:55a0509c4874 | 13 | */ |
| shahidsajid | 4:55a0509c4874 | 14 | class Bat |
| shahidsajid | 4:55a0509c4874 | 15 | { |
| shahidsajid | 4:55a0509c4874 | 16 | |
| shahidsajid | 4:55a0509c4874 | 17 | public: |
| shahidsajid | 4:55a0509c4874 | 18 | Bat(); |
| shahidsajid | 4:55a0509c4874 | 19 | ~Bat(); |
| shahidsajid | 4:55a0509c4874 | 20 | void init(int x,int y); |
| shahidsajid | 4:55a0509c4874 | 21 | void draw(N5110 &lcd); |
| shahidsajid | 4:55a0509c4874 | 22 | void update(); |
| shahidsajid | 21:a0904159e183 | 23 | int get_hitBall(UX &ux); |
| shahidsajid | 13:924891519a95 | 24 | void reset(); |
| shahidsajid | 21:a0904159e183 | 25 | int get_loft_ball(UX &ux); |
| shahidsajid | 4:55a0509c4874 | 26 | /// accessors and mutators |
| shahidsajid | 14:122eaa3b7a50 | 27 | |
| shahidsajid | 4:55a0509c4874 | 28 | |
| shahidsajid | 4:55a0509c4874 | 29 | private: |
| shahidsajid | 14:122eaa3b7a50 | 30 | |
| shahidsajid | 14:122eaa3b7a50 | 31 | |
| shahidsajid | 6:3e50f2cf4366 | 32 | Gamepad batPad; |
| shahidsajid | 6:3e50f2cf4366 | 33 | int _hitBall; |
| shahidsajid | 13:924891519a95 | 34 | int _loft_ball; |
| shahidsajid | 4:55a0509c4874 | 35 | int d; |
| shahidsajid | 6:3e50f2cf4366 | 36 | Direction _d; |
| shahidsajid | 4:55a0509c4874 | 37 | int _size; |
| shahidsajid | 4:55a0509c4874 | 38 | int _x; |
| shahidsajid | 4:55a0509c4874 | 39 | int _y; |
| shahidsajid | 4:55a0509c4874 | 40 | }; |
| shahidsajid | 4:55a0509c4874 | 41 | #endif |