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.
Ball/Ball.h@76:52410264a72d, 2019-05-06 (annotated)
- Committer:
- jamesheavey
- Date:
- Mon May 06 13:07:19 2019 +0000
- Revision:
- 76:52410264a72d
- Parent:
- 0:7d4d2023ed9c
- Child:
- 86:01f33d94e496
ball inits in the right place now
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jamesheavey | 0:7d4d2023ed9c | 1 | #ifndef BALL_H |
jamesheavey | 0:7d4d2023ed9c | 2 | #define BALL_H |
jamesheavey | 0:7d4d2023ed9c | 3 | |
jamesheavey | 0:7d4d2023ed9c | 4 | #include "mbed.h" |
jamesheavey | 0:7d4d2023ed9c | 5 | #include "N5110.h" |
jamesheavey | 0:7d4d2023ed9c | 6 | #include "Gamepad.h" |
jamesheavey | 0:7d4d2023ed9c | 7 | #include "Paddle.h" |
jamesheavey | 0:7d4d2023ed9c | 8 | |
jamesheavey | 0:7d4d2023ed9c | 9 | /** Ball Class |
jamesheavey | 0:7d4d2023ed9c | 10 | @author Dr Craig A. Evans, University of Leeds |
jamesheavey | 0:7d4d2023ed9c | 11 | @brief Controls the ball in the Pong game |
jamesheavey | 0:7d4d2023ed9c | 12 | @date Febraury 2017 |
jamesheavey | 0:7d4d2023ed9c | 13 | */ |
jamesheavey | 0:7d4d2023ed9c | 14 | class Ball |
jamesheavey | 0:7d4d2023ed9c | 15 | { |
jamesheavey | 0:7d4d2023ed9c | 16 | |
jamesheavey | 0:7d4d2023ed9c | 17 | public: |
jamesheavey | 0:7d4d2023ed9c | 18 | Ball(); |
jamesheavey | 0:7d4d2023ed9c | 19 | ~Ball(); |
jamesheavey | 76:52410264a72d | 20 | void init(int size,int speed,int x); |
jamesheavey | 0:7d4d2023ed9c | 21 | void draw(N5110 &lcd); |
jamesheavey | 0:7d4d2023ed9c | 22 | void update(); |
jamesheavey | 0:7d4d2023ed9c | 23 | /// accessors and mutators |
jamesheavey | 0:7d4d2023ed9c | 24 | void set_velocity(Vector2D v); |
jamesheavey | 0:7d4d2023ed9c | 25 | Vector2D get_velocity(); |
jamesheavey | 0:7d4d2023ed9c | 26 | Vector2D get_pos(); |
jamesheavey | 0:7d4d2023ed9c | 27 | void set_pos(Vector2D p); |
jamesheavey | 0:7d4d2023ed9c | 28 | |
jamesheavey | 0:7d4d2023ed9c | 29 | private: |
jamesheavey | 0:7d4d2023ed9c | 30 | |
jamesheavey | 0:7d4d2023ed9c | 31 | Vector2D _velocity; |
jamesheavey | 0:7d4d2023ed9c | 32 | int _size; |
jamesheavey | 0:7d4d2023ed9c | 33 | int _x; |
jamesheavey | 0:7d4d2023ed9c | 34 | int _y; |
jamesheavey | 0:7d4d2023ed9c | 35 | }; |
jamesheavey | 0:7d4d2023ed9c | 36 | #endif |