![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Mochu Yao explorer game
Dependencies: mbed
Diff: line/surface.h
- Revision:
- 7:88c4ba6bb37b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/line/surface.h Thu Apr 23 07:49:39 2020 +0000 @@ -0,0 +1,51 @@ +/** surface +* @the surface file has three functions +//1 the leftside of the line move toward right then the rightside should also move to the right to keep the length +//2 the line will be random length but must be suitable +//3 makesure there are two surface for player to stay +* @date April 22th 2020 +* @author Yaomochu +*/ +#ifndef LINE_H +#define LINE_H + +#include "mbed.h" +//the surface function is to creat the surface for player to stand on and move +struct Line { + int length; + int left; + int right; + int y; + }; + //the line structer will have four main elements + class Surface +{ +public: +Surface(); +~Surface(); +void init(int left, int right, int y1, int y2); +//init the line at first to set the initial position +void line_1(); +void line_2(); +void line_3(); +void line_4(); +void line_5(); +void line_6(); +void getline_1(); +void getline_2(); +void getline_3(); +void getline_4(); +void getline_5(); +void getline_6(); + +private: +Line _line_1; +Line _line_2; +Line _line_3; +Line _line_4; +Line _line_5; +Line _line_6; + +}; +#endif +