201377806 ZiWei Liu
Embed:
(wiki syntax)
Show/hide line numbers
Block.h
00001 #ifndef BLOCK_H 00002 #define BLOCK_H 00003 00004 #include"mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 00008 /** Block class 00009 * @create the wall and control the update of the wall's position 00010 * @author ZiWei Liu Alex 00011 * @date May,2020 00012 */ 00013 00014 class Block{ 00015 00016 private: 00017 00018 int x1_up; 00019 int y1_up; 00020 int x1_down; 00021 int y1_down; 00022 int x2_up; 00023 int y2_up; 00024 int x2_down; 00025 int y2_down; 00026 int score; 00027 00028 public: 00029 /**Constructor*/ 00030 Block(); 00031 /**Destructor*/ 00032 ~Block(); 00033 00034 /** initiate the wall position 00035 * @param 8 coordinates for the wall(two lines) 00036 */ 00037 void blockinit(int x1up, int y1up, int x1down, int y1down, int x2up, int y2up, int x2down, int y2down); 00038 00039 /** draw the block 00040 * @param the lcd screen 00041 */ 00042 void draw_block(N5110 &lcd); 00043 00044 /** the upgrate of x coordinates for score 1-10(level 1)*/ 00045 void blockupgrate(); 00046 /** the upgrate of x coordinates for score 11-20(level 2)*/ 00047 void blockupgrate2(); 00048 /** the upgrate of x coordinates for score 21-30(level 3)*/ 00049 void blockupgrate3(); 00050 /** the upgrate of x coordinates for score 31-40(level 4)*/ 00051 void blockupgrate4(); 00052 /** the upgrate of y coordinates*/ 00053 void y_update(); 00054 00055 /** get the position of x1up and y1up 00056 * return the vector contains the postion of x1up and y1up 00057 */ 00058 Vector2D getposition1(); 00059 /** get the position of x1down and y1down 00060 * return the vector contains the postion of x1down and y1down 00061 */ 00062 Vector2D getposition2(); 00063 /** get the position of x2up and y2up 00064 * return the vector contains the postion of x2up and y2up 00065 */ 00066 Vector2D getposition3(); 00067 /** get the position of x2down and y2down 00068 * return the vector contains the postion of x2down and y2down 00069 */ 00070 Vector2D getposition4(); 00071 00072 /** add score by 1*/ 00073 void add_score(); 00074 00075 /** get the score 00076 * @return the current score 00077 */ 00078 int get_score(); 00079 00080 00081 }; 00082 00083 #endif
Generated on Sat Jul 16 2022 00:49:04 by
1.7.2