Haoyan Zhang
/
el17h2z1
deemo1
Laser/Laser.h@1:8c48fb8ca5e0, 2020-05-11 (annotated)
- Committer:
- haoyan
- Date:
- Mon May 11 06:50:18 2020 +0000
- Revision:
- 1:8c48fb8ca5e0
Finish
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
haoyan | 1:8c48fb8ca5e0 | 1 | #ifndef LASER_H |
haoyan | 1:8c48fb8ca5e0 | 2 | #define LASER_H |
haoyan | 1:8c48fb8ca5e0 | 3 | |
haoyan | 1:8c48fb8ca5e0 | 4 | #include "mbed.h" |
haoyan | 1:8c48fb8ca5e0 | 5 | #include "N5110.h" |
haoyan | 1:8c48fb8ca5e0 | 6 | #include "Gamepad.h" |
haoyan | 1:8c48fb8ca5e0 | 7 | #include "Battleship.h" |
haoyan | 1:8c48fb8ca5e0 | 8 | /** Laser Class |
haoyan | 1:8c48fb8ca5e0 | 9 | * @brief Laser |
haoyan | 1:8c48fb8ca5e0 | 10 | * @author Haoyan Zhang |
haoyan | 1:8c48fb8ca5e0 | 11 | * @date April, 2020 |
haoyan | 1:8c48fb8ca5e0 | 12 | */ |
haoyan | 1:8c48fb8ca5e0 | 13 | |
haoyan | 1:8c48fb8ca5e0 | 14 | class Laser |
haoyan | 1:8c48fb8ca5e0 | 15 | { |
haoyan | 1:8c48fb8ca5e0 | 16 | public: |
haoyan | 1:8c48fb8ca5e0 | 17 | |
haoyan | 1:8c48fb8ca5e0 | 18 | Laser(); |
haoyan | 1:8c48fb8ca5e0 | 19 | |
haoyan | 1:8c48fb8ca5e0 | 20 | ~Laser(); |
haoyan | 1:8c48fb8ca5e0 | 21 | |
haoyan | 1:8c48fb8ca5e0 | 22 | void init(int height,int width,int speed); |
haoyan | 1:8c48fb8ca5e0 | 23 | |
haoyan | 1:8c48fb8ca5e0 | 24 | void draw(N5110 &lcd); |
haoyan | 1:8c48fb8ca5e0 | 25 | |
haoyan | 1:8c48fb8ca5e0 | 26 | void update(); |
haoyan | 1:8c48fb8ca5e0 | 27 | |
haoyan | 1:8c48fb8ca5e0 | 28 | void set_velocity(Vector2D v); |
haoyan | 1:8c48fb8ca5e0 | 29 | |
haoyan | 1:8c48fb8ca5e0 | 30 | Vector2D get_velocity(); |
haoyan | 1:8c48fb8ca5e0 | 31 | |
haoyan | 1:8c48fb8ca5e0 | 32 | Vector2D get_pos(); |
haoyan | 1:8c48fb8ca5e0 | 33 | |
haoyan | 1:8c48fb8ca5e0 | 34 | void set_pos(Vector2D p); |
haoyan | 1:8c48fb8ca5e0 | 35 | |
haoyan | 1:8c48fb8ca5e0 | 36 | private: |
haoyan | 1:8c48fb8ca5e0 | 37 | |
haoyan | 1:8c48fb8ca5e0 | 38 | Vector2D _velocity; |
haoyan | 1:8c48fb8ca5e0 | 39 | |
haoyan | 1:8c48fb8ca5e0 | 40 | Battleship _Battleship; |
haoyan | 1:8c48fb8ca5e0 | 41 | |
haoyan | 1:8c48fb8ca5e0 | 42 | int _height; |
haoyan | 1:8c48fb8ca5e0 | 43 | |
haoyan | 1:8c48fb8ca5e0 | 44 | int _width; |
haoyan | 1:8c48fb8ca5e0 | 45 | |
haoyan | 1:8c48fb8ca5e0 | 46 | int _x; |
haoyan | 1:8c48fb8ca5e0 | 47 | |
haoyan | 1:8c48fb8ca5e0 | 48 | int _y; |
haoyan | 1:8c48fb8ca5e0 | 49 | |
haoyan | 1:8c48fb8ca5e0 | 50 | }; |
haoyan | 1:8c48fb8ca5e0 | 51 | #endif |
haoyan | 1:8c48fb8ca5e0 | 52 | |
haoyan | 1:8c48fb8ca5e0 | 53 | |
haoyan | 1:8c48fb8ca5e0 | 54 | |
haoyan | 1:8c48fb8ca5e0 | 55 | |
haoyan | 1:8c48fb8ca5e0 | 56 | |
haoyan | 1:8c48fb8ca5e0 | 57 | |
haoyan | 1:8c48fb8ca5e0 | 58 | |
haoyan | 1:8c48fb8ca5e0 | 59 | |
haoyan | 1:8c48fb8ca5e0 | 60 |