Mochu Yao explorer game
Dependencies: mbed
Surface/surface.h@8:201ef0618b7d, 2020-04-27 (annotated)
- Committer:
- el17my
- Date:
- Mon Apr 27 08:41:29 2020 +0000
- Revision:
- 8:201ef0618b7d
- Parent:
- line/surface.h@7:88c4ba6bb37b
- Child:
- 10:559487aac60e
creating the menu
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17my | 7:88c4ba6bb37b | 1 | /** surface |
el17my | 7:88c4ba6bb37b | 2 | * @the surface file has three functions |
el17my | 7:88c4ba6bb37b | 3 | //1 the leftside of the line move toward right then the rightside should also move to the right to keep the length |
el17my | 7:88c4ba6bb37b | 4 | //2 the line will be random length but must be suitable |
el17my | 7:88c4ba6bb37b | 5 | //3 makesure there are two surface for player to stay |
el17my | 7:88c4ba6bb37b | 6 | * @date April 22th 2020 |
el17my | 7:88c4ba6bb37b | 7 | * @author Yaomochu |
el17my | 7:88c4ba6bb37b | 8 | */ |
el17my | 7:88c4ba6bb37b | 9 | #ifndef LINE_H |
el17my | 7:88c4ba6bb37b | 10 | #define LINE_H |
el17my | 7:88c4ba6bb37b | 11 | |
el17my | 7:88c4ba6bb37b | 12 | #include "mbed.h" |
el17my | 7:88c4ba6bb37b | 13 | //the surface function is to creat the surface for player to stand on and move |
el17my | 7:88c4ba6bb37b | 14 | struct Line { |
el17my | 7:88c4ba6bb37b | 15 | int length; |
el17my | 7:88c4ba6bb37b | 16 | int left; |
el17my | 7:88c4ba6bb37b | 17 | int right; |
el17my | 7:88c4ba6bb37b | 18 | int y; |
el17my | 7:88c4ba6bb37b | 19 | }; |
el17my | 7:88c4ba6bb37b | 20 | //the line structer will have four main elements |
el17my | 7:88c4ba6bb37b | 21 | class Surface |
el17my | 7:88c4ba6bb37b | 22 | { |
el17my | 7:88c4ba6bb37b | 23 | public: |
el17my | 7:88c4ba6bb37b | 24 | Surface(); |
el17my | 7:88c4ba6bb37b | 25 | ~Surface(); |
el17my | 8:201ef0618b7d | 26 | void init(int y1, int y2); |
el17my | 7:88c4ba6bb37b | 27 | //init the line at first to set the initial position |
el17my | 7:88c4ba6bb37b | 28 | void line_1(); |
el17my | 7:88c4ba6bb37b | 29 | void line_2(); |
el17my | 7:88c4ba6bb37b | 30 | void line_3(); |
el17my | 7:88c4ba6bb37b | 31 | void line_4(); |
el17my | 7:88c4ba6bb37b | 32 | void line_5(); |
el17my | 7:88c4ba6bb37b | 33 | void line_6(); |
el17my | 8:201ef0618b7d | 34 | Line getline_1(); |
el17my | 8:201ef0618b7d | 35 | Line getline_2(); |
el17my | 8:201ef0618b7d | 36 | Line getline_3(); |
el17my | 8:201ef0618b7d | 37 | Line getline_4(); |
el17my | 8:201ef0618b7d | 38 | Line getline_5(); |
el17my | 8:201ef0618b7d | 39 | Line getline_6(); |
el17my | 7:88c4ba6bb37b | 40 | |
el17my | 7:88c4ba6bb37b | 41 | private: |
el17my | 7:88c4ba6bb37b | 42 | Line _line_1; |
el17my | 7:88c4ba6bb37b | 43 | Line _line_2; |
el17my | 7:88c4ba6bb37b | 44 | Line _line_3; |
el17my | 7:88c4ba6bb37b | 45 | Line _line_4; |
el17my | 7:88c4ba6bb37b | 46 | Line _line_5; |
el17my | 7:88c4ba6bb37b | 47 | Line _line_6; |
el17my | 7:88c4ba6bb37b | 48 | |
el17my | 7:88c4ba6bb37b | 49 | }; |
el17my | 7:88c4ba6bb37b | 50 | #endif |
el17my | 7:88c4ba6bb37b | 51 |