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
Bullet/Bullet.h@6:b393cfe4e0a7, 2020-05-28 (annotated)
- Committer:
- ChenZirui
- Date:
- Thu May 28 01:11:47 2020 +0000
- Revision:
- 6:b393cfe4e0a7
- Parent:
- 5:7207c9b70108
- Child:
- 7:f61ac963eb07
not final
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ChenZirui | 5:7207c9b70108 | 1 | #ifndef Bullet_H |
ChenZirui | 5:7207c9b70108 | 2 | #define Bullet_H |
ChenZirui | 5:7207c9b70108 | 3 | |
ChenZirui | 5:7207c9b70108 | 4 | #include "mbed.h" |
ChenZirui | 5:7207c9b70108 | 5 | #include "N5110.h" |
ChenZirui | 5:7207c9b70108 | 6 | #include "Gamepad.h" |
ChenZirui | 5:7207c9b70108 | 7 | #include "Board.h" |
ChenZirui | 5:7207c9b70108 | 8 | |
ChenZirui | 5:7207c9b70108 | 9 | /** Bullet Class |
ChenZirui | 5:7207c9b70108 | 10 | @author Dr Craig A. Evans, University of Leeds |
ChenZirui | 5:7207c9b70108 | 11 | @brief Controls the Bullet in the Pong game |
ChenZirui | 5:7207c9b70108 | 12 | @date Febraury 2017 |
ChenZirui | 5:7207c9b70108 | 13 | */ |
ChenZirui | 5:7207c9b70108 | 14 | class Bullet |
ChenZirui | 5:7207c9b70108 | 15 | { |
ChenZirui | 5:7207c9b70108 | 16 | |
ChenZirui | 5:7207c9b70108 | 17 | public: |
ChenZirui | 5:7207c9b70108 | 18 | Bullet(); |
ChenZirui | 5:7207c9b70108 | 19 | ~Bullet(); |
ChenZirui | 5:7207c9b70108 | 20 | void init(int x,int size,int speed,int height); |
ChenZirui | 5:7207c9b70108 | 21 | void draw(N5110 &lcd); |
ChenZirui | 6:b393cfe4e0a7 | 22 | void update(); |
ChenZirui | 5:7207c9b70108 | 23 | /// accessors and mutators |
ChenZirui | 5:7207c9b70108 | 24 | void set_velocity(Vector2D v); |
ChenZirui | 5:7207c9b70108 | 25 | Vector2D get_velocity(); |
ChenZirui | 5:7207c9b70108 | 26 | Vector2D get_pos(); |
ChenZirui | 5:7207c9b70108 | 27 | void set_pos(Vector2D p); |
ChenZirui | 5:7207c9b70108 | 28 | |
ChenZirui | 5:7207c9b70108 | 29 | private: |
ChenZirui | 5:7207c9b70108 | 30 | |
ChenZirui | 5:7207c9b70108 | 31 | Vector2D _velocity; |
ChenZirui | 5:7207c9b70108 | 32 | int _size; |
ChenZirui | 5:7207c9b70108 | 33 | int _x; |
ChenZirui | 5:7207c9b70108 | 34 | int _y; |
ChenZirui | 5:7207c9b70108 | 35 | //Bullet Bullet; |
ChenZirui | 5:7207c9b70108 | 36 | |
ChenZirui | 5:7207c9b70108 | 37 | }; |
ChenZirui | 5:7207c9b70108 | 38 | #endif |