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.
Paddle/Paddle.h@9:f6f0f39538c7, 2019-04-21 (annotated)
- Committer:
- jamesheavey
- Date:
- Sun Apr 21 20:44:24 2019 +0000
- Revision:
- 9:f6f0f39538c7
- Parent:
- 0:7d4d2023ed9c
- Child:
- 16:1761dfe801af
added lives leds, need to make a lose screen when lives = 0 and need to sort collision detection on brick
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jamesheavey | 0:7d4d2023ed9c | 1 | #ifndef PADDLE_H |
jamesheavey | 0:7d4d2023ed9c | 2 | #define PADDLE_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 | |
jamesheavey | 0:7d4d2023ed9c | 8 | class Paddle |
jamesheavey | 0:7d4d2023ed9c | 9 | { |
jamesheavey | 0:7d4d2023ed9c | 10 | public: |
jamesheavey | 0:7d4d2023ed9c | 11 | |
jamesheavey | 0:7d4d2023ed9c | 12 | Paddle(); |
jamesheavey | 0:7d4d2023ed9c | 13 | ~Paddle(); |
jamesheavey | 0:7d4d2023ed9c | 14 | void init(int x,int height,int width); |
jamesheavey | 0:7d4d2023ed9c | 15 | void draw(N5110 &lcd); |
jamesheavey | 0:7d4d2023ed9c | 16 | void update(Direction d,float mag); |
jamesheavey | 0:7d4d2023ed9c | 17 | void add_score(); |
jamesheavey | 9:f6f0f39538c7 | 18 | void lose_life(); |
jamesheavey | 0:7d4d2023ed9c | 19 | int get_score(); |
jamesheavey | 0:7d4d2023ed9c | 20 | Vector2D get_pos(); |
jamesheavey | 9:f6f0f39538c7 | 21 | int get_lives(); |
jamesheavey | 0:7d4d2023ed9c | 22 | |
jamesheavey | 0:7d4d2023ed9c | 23 | private: |
jamesheavey | 0:7d4d2023ed9c | 24 | |
jamesheavey | 0:7d4d2023ed9c | 25 | int _height; |
jamesheavey | 0:7d4d2023ed9c | 26 | int _width; |
jamesheavey | 0:7d4d2023ed9c | 27 | int _x; |
jamesheavey | 0:7d4d2023ed9c | 28 | int _y; |
jamesheavey | 0:7d4d2023ed9c | 29 | int _speed; |
jamesheavey | 0:7d4d2023ed9c | 30 | int _score; |
jamesheavey | 9:f6f0f39538c7 | 31 | int _lives; |
jamesheavey | 0:7d4d2023ed9c | 32 | |
jamesheavey | 0:7d4d2023ed9c | 33 | }; |
jamesheavey | 0:7d4d2023ed9c | 34 | #endif |