勇帜 周
/
2645_Final_project_1
bird
bird/bird.h@2:fb9c05867677, 2019-05-05 (annotated)
- Committer:
- 1013373474
- Date:
- Sun May 05 18:46:58 2019 +0000
- Revision:
- 2:fb9c05867677
- Parent:
- 1:8672e52115e3
- Child:
- 3:d9c2fc1d5984
FLY BIRD
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
1013373474 | 0:3887ebee1b37 | 1 | #include "mbed.h" |
1013373474 | 0:3887ebee1b37 | 2 | #include "N5110.h" |
1013373474 | 0:3887ebee1b37 | 3 | #include "Gamepad.h" |
1013373474 | 0:3887ebee1b37 | 4 | |
1013373474 | 2:fb9c05867677 | 5 | /** |
1013373474 | 2:fb9c05867677 | 6 | *@brief Data struct includes the bird position. |
1013373474 | 2:fb9c05867677 | 7 | */ |
1013373474 | 0:3887ebee1b37 | 8 | |
1013373474 | 0:3887ebee1b37 | 9 | |
1013373474 | 0:3887ebee1b37 | 10 | struct Data{ |
1013373474 | 0:3887ebee1b37 | 11 | int y; |
1013373474 | 0:3887ebee1b37 | 12 | }; |
1013373474 | 2:fb9c05867677 | 13 | |
1013373474 | 2:fb9c05867677 | 14 | |
1013373474 | 2:fb9c05867677 | 15 | /** Cylinder Class |
1013373474 | 2:fb9c05867677 | 16 | *@brief Data used to make the bird |
1013373474 | 2:fb9c05867677 | 17 | *@anthor Zhou Yongzhi |
1013373474 | 2:fb9c05867677 | 18 | *@data May 2019 |
1013373474 | 2:fb9c05867677 | 19 | */ |
1013373474 | 0:3887ebee1b37 | 20 | class bird |
1013373474 | 0:3887ebee1b37 | 21 | { |
1013373474 | 0:3887ebee1b37 | 22 | |
1013373474 | 0:3887ebee1b37 | 23 | |
1013373474 | 0:3887ebee1b37 | 24 | public: |
1013373474 | 2:fb9c05867677 | 25 | /** |
1013373474 | 2:fb9c05867677 | 26 | *@brief initialise the parameters |
1013373474 | 2:fb9c05867677 | 27 | *@param size,speed |
1013373474 | 2:fb9c05867677 | 28 | */ |
1013373474 | 0:3887ebee1b37 | 29 | void init(int size,int speed); |
1013373474 | 2:fb9c05867677 | 30 | /** |
1013373474 | 2:fb9c05867677 | 31 | *@brief initialise the parameters |
1013373474 | 2:fb9c05867677 | 32 | *@param lcd |
1013373474 | 2:fb9c05867677 | 33 | *@details The function in N5110 is used |
1013373474 | 2:fb9c05867677 | 34 | */ |
1013373474 | 0:3887ebee1b37 | 35 | void draw(N5110 &lcd); |
1013373474 | 2:fb9c05867677 | 36 | /** |
1013373474 | 2:fb9c05867677 | 37 | *@brief initialise the parameters |
1013373474 | 2:fb9c05867677 | 38 | *@param lcd,pad |
1013373474 | 2:fb9c05867677 | 39 | *@details The function in N5110 and Gamepad is used |
1013373474 | 2:fb9c05867677 | 40 | */ |
1013373474 | 1:8672e52115e3 | 41 | void check(Gamepad &pad, N5110 &lcd); |
1013373474 | 2:fb9c05867677 | 42 | /** |
1013373474 | 2:fb9c05867677 | 43 | *@brief initialise the parameters |
1013373474 | 2:fb9c05867677 | 44 | */ |
1013373474 | 0:3887ebee1b37 | 45 | void init(); |
1013373474 | 2:fb9c05867677 | 46 | /** |
1013373474 | 2:fb9c05867677 | 47 | *@brief The data which are sent to main.cpp |
1013373474 | 2:fb9c05867677 | 48 | */ |
1013373474 | 0:3887ebee1b37 | 49 | Data get_data(); |
1013373474 | 2:fb9c05867677 | 50 | |
1013373474 | 0:3887ebee1b37 | 51 | |
1013373474 | 0:3887ebee1b37 | 52 | private: |
1013373474 | 0:3887ebee1b37 | 53 | int _y; |
1013373474 | 0:3887ebee1b37 | 54 | Data _data; |
1013373474 | 0:3887ebee1b37 | 55 | }; |