Mochu Yao explorer game
Dependencies: mbed
Surface/surface.h@26:4d193529b447, 2020-04-28 (annotated)
- Committer:
- el17my
- Date:
- Tue Apr 28 17:39:26 2020 +0000
- Revision:
- 26:4d193529b447
- Parent:
- 24:d7a794fd1228
- Child:
- 27:354d91d59b6d
4.29
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17my | 11:6740108a0825 | 1 | #ifndef LINE_H |
el17my | 11:6740108a0825 | 2 | #define LINE_H |
el17my | 11:6740108a0825 | 3 | |
el17my | 11:6740108a0825 | 4 | #include "mbed.h" |
el17my | 10:559487aac60e | 5 | |
el17my | 11:6740108a0825 | 6 | struct Line { |
el17my | 11:6740108a0825 | 7 | int length; |
el17my | 11:6740108a0825 | 8 | int left; |
el17my | 11:6740108a0825 | 9 | int right; |
el17my | 11:6740108a0825 | 10 | int y; |
el17my | 11:6740108a0825 | 11 | }; |
el17my | 23:7be9701fc1b8 | 12 | |
el17my | 10:559487aac60e | 13 | |
el17my | 7:88c4ba6bb37b | 14 | //the surface function is to creat the surface for player to stand on and move |
el17my | 21:349c70c8a7de | 15 | class Surface |
el17my | 7:88c4ba6bb37b | 16 | { |
el17my | 7:88c4ba6bb37b | 17 | public: |
el17my | 7:88c4ba6bb37b | 18 | Surface(); |
el17my | 7:88c4ba6bb37b | 19 | ~Surface(); |
el17my | 8:201ef0618b7d | 20 | void init(int y1, int y2); |
el17my | 7:88c4ba6bb37b | 21 | //init the line at first to set the initial position |
el17my | 7:88c4ba6bb37b | 22 | void line_1(); |
el17my | 7:88c4ba6bb37b | 23 | void line_2(); |
el17my | 7:88c4ba6bb37b | 24 | void line_3(); |
el17my | 7:88c4ba6bb37b | 25 | void line_4(); |
el17my | 7:88c4ba6bb37b | 26 | void line_5(); |
el17my | 7:88c4ba6bb37b | 27 | void line_6(); |
el17my | 8:201ef0618b7d | 28 | Line getline_1(); |
el17my | 8:201ef0618b7d | 29 | Line getline_2(); |
el17my | 8:201ef0618b7d | 30 | Line getline_3(); |
el17my | 8:201ef0618b7d | 31 | Line getline_4(); |
el17my | 8:201ef0618b7d | 32 | Line getline_5(); |
el17my | 8:201ef0618b7d | 33 | Line getline_6(); |
el17my | 7:88c4ba6bb37b | 34 | |
el17my | 7:88c4ba6bb37b | 35 | private: |
el17my | 7:88c4ba6bb37b | 36 | Line _line_1; |
el17my | 7:88c4ba6bb37b | 37 | Line _line_2; |
el17my | 7:88c4ba6bb37b | 38 | Line _line_3; |
el17my | 7:88c4ba6bb37b | 39 | Line _line_4; |
el17my | 7:88c4ba6bb37b | 40 | Line _line_5; |
el17my | 7:88c4ba6bb37b | 41 | Line _line_6; |
el17my | 7:88c4ba6bb37b | 42 | |
el17my | 7:88c4ba6bb37b | 43 | }; |
el17my | 7:88c4ba6bb37b | 44 | #endif |
el17my | 7:88c4ba6bb37b | 45 |