Yang Hongxiao 201199678
Dependencies: mbed
Platform.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 PLATFORM_H |
YHX | 1:a6ead8050c23 | 2 | #define PLATFORM_H |
YHX | 1:a6ead8050c23 | 3 | |
YHX | 1:a6ead8050c23 | 4 | |
YHX | 1:a6ead8050c23 | 5 | #include "mbed.h" |
YHX | 1:a6ead8050c23 | 6 | #include "N5110.h" |
YHX | 1:a6ead8050c23 | 7 | #include "Gamepad.h" |
YHX | 1:a6ead8050c23 | 8 | /** The bullet Class |
YHX | 1:a6ead8050c23 | 9 | * @brief This program define the bullets |
YHX | 1:a6ead8050c23 | 10 | * @author Yang Hongxiao |
YHX | 1:a6ead8050c23 | 11 | * @date 15/5/2020 |
YHX | 1:a6ead8050c23 | 12 | */ |
YHX | 1:a6ead8050c23 | 13 | |
YHX | 1:a6ead8050c23 | 14 | |
YHX | 1:a6ead8050c23 | 15 | class Platform |
YHX | 1:a6ead8050c23 | 16 | { |
YHX | 1:a6ead8050c23 | 17 | public: |
YHX | 1:a6ead8050c23 | 18 | /** Constructor */ |
YHX | 1:a6ead8050c23 | 19 | Platform(); |
YHX | 1:a6ead8050c23 | 20 | /** Destructor */ |
YHX | 1:a6ead8050c23 | 21 | ~Platform(); |
YHX | 1:a6ead8050c23 | 22 | /** Set the inital value |
YHX | 1:a6ead8050c23 | 23 | * @param the y_position of the platformthe(int y), the value of the platform width (int w),the value of the platform height (int h), |
YHX | 1:a6ead8050c23 | 24 | */ |
YHX | 1:a6ead8050c23 | 25 | void init(int y,int h,int w); |
YHX | 1:a6ead8050c23 | 26 | /** draw the platform |
YHX | 1:a6ead8050c23 | 27 | * @param the screen(N5110 &lcd) |
YHX | 1:a6ead8050c23 | 28 | */ |
YHX | 1:a6ead8050c23 | 29 | void draw(N5110 &lcd); |
YHX | 1:a6ead8050c23 | 30 | /** Set the update value |
YHX | 1:a6ead8050c23 | 31 | * @param Direction (Direction d),magnitude(float mag) |
YHX | 1:a6ead8050c23 | 32 | */ |
YHX | 1:a6ead8050c23 | 33 | void update(Direction d,float mag); |
YHX | 1:a6ead8050c23 | 34 | /** Get the position |
YHX | 1:a6ead8050c23 | 35 | * @return the current position |
YHX | 1:a6ead8050c23 | 36 | */ |
YHX | 1:a6ead8050c23 | 37 | Vector2D get_pos(); |
YHX | 1:a6ead8050c23 | 38 | /** Add the score |
YHX | 1:a6ead8050c23 | 39 | * @return the score++ |
YHX | 1:a6ead8050c23 | 40 | */ |
YHX | 1:a6ead8050c23 | 41 | void add_score(); |
YHX | 1:a6ead8050c23 | 42 | /** Get the score |
YHX | 1:a6ead8050c23 | 43 | * @return the current score |
YHX | 1:a6ead8050c23 | 44 | */ |
YHX | 1:a6ead8050c23 | 45 | int get_score(); |
YHX | 1:a6ead8050c23 | 46 | |
YHX | 1:a6ead8050c23 | 47 | |
YHX | 1:a6ead8050c23 | 48 | private: |
YHX | 1:a6ead8050c23 | 49 | |
YHX | 1:a6ead8050c23 | 50 | int _h; //the height of the platform |
YHX | 1:a6ead8050c23 | 51 | int _w; //the width of the platform |
YHX | 1:a6ead8050c23 | 52 | int _x; |
YHX | 1:a6ead8050c23 | 53 | int _y; |
YHX | 1:a6ead8050c23 | 54 | int _vv; //the speed of the platform |
YHX | 1:a6ead8050c23 | 55 | int _score; |
YHX | 1:a6ead8050c23 | 56 | }; |
YHX | 1:a6ead8050c23 | 57 | #endif |