Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Levels.h
00001 #ifndef Levels_H 00002 #define Levels_H 00003 00004 #include "mbed.h" 00005 #include "N5110.h" 00006 #include "Gamepad.h" 00007 #include "Sprites.h" 00008 00009 /////////////Structs for populating up to 6 levels////////////////// 00010 00011 /** Enemy locations for each level struct */ 00012 struct Enemies { 00013 double ex[5]; /**< enemy x positions for each level */ 00014 double ey[5]; /**< enemy y positions for each level */ 00015 int c[5]; /**< enemy counters for each level */ 00016 int d[5]; /**< enemy travel distances for each level */ 00017 double v[5]; /**< varies enemies velocity */ 00018 }; 00019 /** Trap locations for each level struct */ 00020 struct Traps { 00021 double tx[5]; /**< traps x positions for each level */ 00022 double ty[5]; /**< traps y positions for each level */ 00023 }; 00024 /** Key locations for each level struct*/ 00025 struct Keys { 00026 double kx[5]; /**< keys x positions for each level */ 00027 double ky[5]; /**< keys y positions for each level */ 00028 }; 00029 /** block locations for each level struct*/ 00030 struct Solid_blocks { 00031 double bx[5]; /**< blocks x positions for each level */ 00032 double by[5]; /**< blocks y positions for each level */ 00033 }; 00034 /** sinking block locations for each level struct*/ 00035 struct Soft_blocks { 00036 double sx1[5]; /**< sinking blocks x1 positions for each level */ 00037 double sy[5]; /**< sinking blocks y positions for each level */ 00038 int sx2[5]; /**< sinking blocks x2 (length) positions for each level */ 00039 }; 00040 00041 /** Levels Class 00042 @details Sets position of all level objects 00043 @author Andrew Milner University of Leeds 00044 @date April 2019 00045 */ 00046 00047 class Levels 00048 { 00049 public: 00050 /** Constructor 00051 */ 00052 Levels(); 00053 /** Deconstructor 00054 */ 00055 ~Levels(); 00056 /** Level 1 platform positions 00057 */ 00058 void level_platforms1(N5110 &lcd); 00059 /** Level 1 trap positions 00060 */ 00061 void trap_pos1(); 00062 /** Level 1 key positions 00063 */ 00064 void key_pos1(); 00065 /** Level 1 block positions 00066 */ 00067 void block_pos1(); 00068 /** Level 1 sinking block positions 00069 */ 00070 void soft_pos1(); 00071 /** Level 1 enemy positions 00072 */ 00073 void enem_pos1(); 00074 00075 /** Level 2 platform positions 00076 */ 00077 void level_platforms2(N5110 &lcd); 00078 /** Level 2 key positions 00079 */ 00080 void key_pos2(); 00081 /** Level 2 trap positions 00082 */ 00083 void trap_pos2(); 00084 /** Level 2 enemy positions 00085 */ 00086 void enem_pos2(); 00087 /** Level 2 block positions 00088 */ 00089 void block_pos2(); 00090 /** Level 2 sinking block positions 00091 */ 00092 void soft_pos2(); 00093 00094 /** Level 3 platform positions 00095 */ 00096 void level_platforms3(N5110 &lcd); 00097 /** Level 3 key positions 00098 */ 00099 void key_pos3(); 00100 /** Level 3 trap positions 00101 */ 00102 void trap_pos3(); 00103 /** Level 3 enemy positions 00104 */ 00105 void enem_pos3(); 00106 /** Level 3 block positions 00107 */ 00108 void block_pos3(); 00109 /** Level 3 sinking block positions 00110 */ 00111 void soft_pos3(); 00112 00113 /** Level 4 platform positions 00114 */ 00115 void level_platforms4(N5110 &lcd); 00116 /** Level 4 key positions 00117 */ 00118 void key_pos4(); 00119 /** Level 4 trap positions 00120 */ 00121 void trap_pos4(); 00122 /** Level 4 enemy positions 00123 */ 00124 void enem_pos4(); 00125 /** Level 4 block positions 00126 */ 00127 void block_pos4(); 00128 /** Level 4 sinking block positions 00129 */ 00130 void soft_pos4(); 00131 00132 00133 Traps trap1, trap2, trap3, trap4, trap5; 00134 Keys key1, key2, key3, key4, key5; 00135 Solid_blocks sol1, sol2, sol3, sol4, sol5; 00136 Soft_blocks sof1, sof2, sof3, sof4, sof5; 00137 Enemies enem1, enem2, enem3; 00138 00139 private: 00140 00141 Sprites _sprites; 00142 Direction _d; 00143 00144 }; 00145 #endif
Generated on Wed Jul 13 2022 01:25:32 by
1.7.2