Yang Hongxiao 201199678
Dependencies: mbed
Obstacle.h@1:a6ead8050c23, 2020-05-14 (annotated)
- Committer:
- YHX
- Date:
- Thu May 14 17:00:34 2020 +0000
- Revision:
- 1:a6ead8050c23
Yang Hongxiao; el17hy; 201199678
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YHX | 1:a6ead8050c23 | 1 | #ifndef OBSTACLE_H |
YHX | 1:a6ead8050c23 | 2 | #define OBSTACLE_H |
YHX | 1:a6ead8050c23 | 3 | |
YHX | 1:a6ead8050c23 | 4 | #include "Gamepad.h" |
YHX | 1:a6ead8050c23 | 5 | #include "mbed.h" |
YHX | 1:a6ead8050c23 | 6 | #include "N5110.h" |
YHX | 1:a6ead8050c23 | 7 | /** The bullet Class |
YHX | 1:a6ead8050c23 | 8 | * @brief This program define the obstacle |
YHX | 1:a6ead8050c23 | 9 | * @author Yang Hongxiao |
YHX | 1:a6ead8050c23 | 10 | * @date 15/5/2020 |
YHX | 1:a6ead8050c23 | 11 | */ |
YHX | 1:a6ead8050c23 | 12 | |
YHX | 1:a6ead8050c23 | 13 | |
YHX | 1:a6ead8050c23 | 14 | class Obstacle{ |
YHX | 1:a6ead8050c23 | 15 | |
YHX | 1:a6ead8050c23 | 16 | public: |
YHX | 1:a6ead8050c23 | 17 | /** Constructor */ |
YHX | 1:a6ead8050c23 | 18 | Obstacle(); |
YHX | 1:a6ead8050c23 | 19 | /** Destructor */ |
YHX | 1:a6ead8050c23 | 20 | ~Obstacle(); |
YHX | 1:a6ead8050c23 | 21 | /** Set the inital value |
YHX | 1:a6ead8050c23 | 22 | * @param the value of the Obstacle pos.x (int _x),the value of the Obstacle pos.y (int _y), |
YHX | 1:a6ead8050c23 | 23 | */ |
YHX | 1:a6ead8050c23 | 24 | void init(); |
YHX | 1:a6ead8050c23 | 25 | /**draw the Obstacle |
YHX | 1:a6ead8050c23 | 26 | * @param the screen(N5110 &lcd) |
YHX | 1:a6ead8050c23 | 27 | */ |
YHX | 1:a6ead8050c23 | 28 | void draw(N5110 &lcd); |
YHX | 1:a6ead8050c23 | 29 | /** Get the obstacle position |
YHX | 1:a6ead8050c23 | 30 | * @return the current position |
YHX | 1:a6ead8050c23 | 31 | */ |
YHX | 1:a6ead8050c23 | 32 | Vector2D get_obstacle_pos(); |
YHX | 1:a6ead8050c23 | 33 | /** Get the new obstacle position |
YHX | 1:a6ead8050c23 | 34 | * @return the current position of the new obstacle |
YHX | 1:a6ead8050c23 | 35 | */ |
YHX | 1:a6ead8050c23 | 36 | void new_obstacle(); |
YHX | 1:a6ead8050c23 | 37 | |
YHX | 1:a6ead8050c23 | 38 | |
YHX | 1:a6ead8050c23 | 39 | |
YHX | 1:a6ead8050c23 | 40 | private: |
YHX | 1:a6ead8050c23 | 41 | int _x; |
YHX | 1:a6ead8050c23 | 42 | int _y; |
YHX | 1:a6ead8050c23 | 43 | |
YHX | 1:a6ead8050c23 | 44 | }; |
YHX | 1:a6ead8050c23 | 45 | #endif |