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
Ball/Ball.h@8:10eb578dd754, 2020-05-18 (annotated)
- Committer:
- ll17lrc
- Date:
- Mon May 18 15:08:54 2020 +0000
- Revision:
- 8:10eb578dd754
- Parent:
- 7:35465b3bf586
- Child:
- 13:fd290d2fd917
Level two complete;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ll17lrc | 2:823dea76ff2e | 1 | #ifndef BALL_H |
ll17lrc | 2:823dea76ff2e | 2 | #define BALL_H |
ll17lrc | 2:823dea76ff2e | 3 | |
ll17lrc | 2:823dea76ff2e | 4 | #include "mbed.h" |
ll17lrc | 2:823dea76ff2e | 5 | #include "N5110.h" |
ll17lrc | 2:823dea76ff2e | 6 | #include "Gamepad.h" |
ll17lrc | 2:823dea76ff2e | 7 | |
ll17lrc | 2:823dea76ff2e | 8 | /** Ball Class |
ll17lrc | 2:823dea76ff2e | 9 | @author Dr Craig A. Evans, University of Leeds |
ll17lrc | 2:823dea76ff2e | 10 | @brief Controls the ball in the Pong game |
ll17lrc | 2:823dea76ff2e | 11 | @date Febraury 2017 |
ll17lrc | 2:823dea76ff2e | 12 | */ |
ll17lrc | 2:823dea76ff2e | 13 | class Ball |
ll17lrc | 2:823dea76ff2e | 14 | { |
ll17lrc | 2:823dea76ff2e | 15 | |
ll17lrc | 2:823dea76ff2e | 16 | public: |
ll17lrc | 2:823dea76ff2e | 17 | Ball(); |
ll17lrc | 2:823dea76ff2e | 18 | ~Ball(); |
ll17lrc | 7:35465b3bf586 | 19 | void init(int x,int y); |
ll17lrc | 2:823dea76ff2e | 20 | void draw(N5110 &lcd); |
ll17lrc | 8:10eb578dd754 | 21 | void update(Direction d,Gamepad &pad); |
ll17lrc | 4:a9d5fca3b7ba | 22 | void level_finish(); |
ll17lrc | 4:a9d5fca3b7ba | 23 | int get_ball_x_pos(); |
ll17lrc | 4:a9d5fca3b7ba | 24 | int get_ball_y_pos(); |
ll17lrc | 2:823dea76ff2e | 25 | /// accessors and mutators |
ll17lrc | 2:823dea76ff2e | 26 | |
ll17lrc | 2:823dea76ff2e | 27 | private: |
ll17lrc | 2:823dea76ff2e | 28 | |
ll17lrc | 7:35465b3bf586 | 29 | int ball; |
ll17lrc | 4:a9d5fca3b7ba | 30 | int ball_x_pos; |
ll17lrc | 4:a9d5fca3b7ba | 31 | int ball_y_pos; |
ll17lrc | 4:a9d5fca3b7ba | 32 | |
ll17lrc | 2:823dea76ff2e | 33 | }; |
ll17lrc | 2:823dea76ff2e | 34 | #endif |