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.
Laser/Laser.h@91:c01a736fb0d9, 2019-05-06 (annotated)
- Committer:
- jamesheavey
- Date:
- Mon May 06 22:57:04 2019 +0000
- Revision:
- 91:c01a736fb0d9
- Parent:
- 86:01f33d94e496
- Child:
- 93:18f81996ea89
paddle commented
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| jamesheavey | 28:d058f7f5885d | 1 | #ifndef LASER_H |
| jamesheavey | 28:d058f7f5885d | 2 | #define LASER_H |
| jamesheavey | 28:d058f7f5885d | 3 | |
| jamesheavey | 28:d058f7f5885d | 4 | #include "mbed.h" |
| jamesheavey | 28:d058f7f5885d | 5 | #include "N5110.h" |
| jamesheavey | 28:d058f7f5885d | 6 | #include "Gamepad.h" |
| jamesheavey | 28:d058f7f5885d | 7 | #include "Paddle.h" |
| jamesheavey | 28:d058f7f5885d | 8 | |
| jamesheavey | 86:01f33d94e496 | 9 | /* Laser Class |
| jamesheavey | 86:01f33d94e496 | 10 | @author James Heavey, University of Leeds |
| jamesheavey | 91:c01a736fb0d9 | 11 | @brief Controls the Laser in the Breakout game |
| jamesheavey | 86:01f33d94e496 | 12 | @date May 2019 |
| jamesheavey | 91:c01a736fb0d9 | 13 | */ |
| jamesheavey | 28:d058f7f5885d | 14 | class Laser |
| jamesheavey | 28:d058f7f5885d | 15 | { |
| jamesheavey | 28:d058f7f5885d | 16 | |
| jamesheavey | 28:d058f7f5885d | 17 | public: |
| jamesheavey | 28:d058f7f5885d | 18 | Laser(); |
| jamesheavey | 28:d058f7f5885d | 19 | ~Laser(); |
| jamesheavey | 28:d058f7f5885d | 20 | void init(int x); |
| jamesheavey | 28:d058f7f5885d | 21 | void draw(N5110 &lcd); |
| jamesheavey | 28:d058f7f5885d | 22 | void update(); |
| jamesheavey | 28:d058f7f5885d | 23 | /// accessors and mutators |
| jamesheavey | 36:cb73014d3a99 | 24 | int get_x(); |
| jamesheavey | 36:cb73014d3a99 | 25 | int get_y(); |
| jamesheavey | 36:cb73014d3a99 | 26 | void set_posx(int x); |
| jamesheavey | 36:cb73014d3a99 | 27 | void set_posy(int y); |
| jamesheavey | 91:c01a736fb0d9 | 28 | |
| jamesheavey | 28:d058f7f5885d | 29 | private: |
| jamesheavey | 28:d058f7f5885d | 30 | |
| jamesheavey | 28:d058f7f5885d | 31 | Vector2D _velocity; |
| jamesheavey | 28:d058f7f5885d | 32 | int _x; |
| jamesheavey | 28:d058f7f5885d | 33 | int _y; |
| jamesheavey | 28:d058f7f5885d | 34 | }; |
| jamesheavey | 28:d058f7f5885d | 35 | #endif |