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
Diff: Levels/Levels.cpp
- Revision:
- 58:4a826093d9e9
- Parent:
- 54:7fa8c07fdea4
--- a/Levels/Levels.cpp Wed Apr 24 20:56:36 2019 +0000
+++ b/Levels/Levels.cpp Tue May 07 00:30:46 2019 +0000
@@ -88,13 +88,6 @@
sof3.sy[0] = 9;
sof3.sx2[0] = 52;
- sof4.sx1[0] = 0;
- sof4.sy[0] = 0;
- sof4.sx2[0] = 0;
-
- sof5.sx1[0] = 0;
- sof5.sy[0] = 0;
- sof5.sx2[0] = 0;
}
// sets all enemy positions for level 1
@@ -126,17 +119,17 @@
lcd.drawRect(20, 41, 12, 2, FILL_BLACK);
lcd.drawRect(36, 37, 12, 2, FILL_BLACK);
lcd.drawRect(48, 29, 12, 2, FILL_BLACK);
- lcd.drawRect(20, 21, 24, 2, FILL_BLACK);
- lcd.drawRect(0, 10, 49, 2, FILL_BLACK);
+ lcd.drawRect(24, 21, 24, 2, FILL_BLACK);
+ lcd.drawRect(20, 10, 29, 2, FILL_BLACK);
lcd.drawRect(54, 14, 12, 2, FILL_BLACK);
- lcd.drawRect(66, 8, 12, 2, FILL_BLACK);
+ lcd.drawRect(0, 10, 10, 2, FILL_BLACK);
}
// key positions for level 2
void Levels::key_pos2()
{
- key1.kx[1] = 51;
- key1.ky[1] = 39;
+ key1.kx[1] = 55;
+ key1.ky[1] = 44;
key2.kx[1] = 79;
key2.ky[1] = 29;
@@ -147,8 +140,8 @@
key4.kx[1] = 24;
key4.ky[1] = 0;
- key5.kx[1] = 69;
- key5.ky[1] = 5;
+ key5.kx[1] = 1;
+ key5.ky[1] = 7;
}
// trap positions for level 2
@@ -173,14 +166,14 @@
// enemy positions for level 2
void Levels::enem_pos2()
{
- enem1.ex[1] = 20;
+ enem1.ex[1] = 24;
enem1.ey[1] = 16;
enem1.d[1] = 44;
enem1.v[1] = 0.5;
- enem2.ex[1] = 0;
+ enem2.ex[1] = 20;
enem2.ey[1] = 5;
- enem2.d[1] = 28;
+ enem2.d[1] = 27;
enem2.v[1] = 1;
enem3.ex[1] = 54;
@@ -232,6 +225,8 @@
sof5.sx2[1] = 84;
}
+/////////////////level 3 objects /////////////////////////
+
// platform positions for level 3
void Levels::level_platforms3(N5110 &lcd)
{
@@ -244,8 +239,6 @@
}
-/////////////////level 3 objects /////////////////////////
-
// key positions for level 3
void Levels::key_pos3()
{
@@ -333,15 +326,105 @@
sof2.sy[2] = 10;
sof2.sx2[2] = 84;
- sof3.sx1[2] = 0;
- sof3.sy[2] = 0;
- sof3.sx2[2] = 0;
+}
+
+/////////////////level 4 objects /////////////////////////
+
+void Levels::level_platforms4(N5110 &lcd)
+{
+ lcd.drawLine(0, 47, 83, 47, 1);
+ lcd.drawRect(36, 31, 6, 2, FILL_BLACK);
+ lcd.drawRect(30, 10, 42, 2, FILL_BLACK);
+ lcd.drawRect(78, 20, 6, 2, FILL_BLACK);
+ lcd.drawRect(66, 26, 10, 2, FILL_BLACK);
+ lcd.drawRect(54, 30, 10, 2, FILL_BLACK);
+
+}
+
+// key positions for level 4
+void Levels::key_pos4()
+{
+ key1.kx[3] = 38;
+ key1.ky[3] = 7;
+
+ key2.kx[3] = 66;
+ key2.ky[3] = 7;
+
+ key3.kx[3] = 0;
+ key3.ky[3] = 5;
+
+ key4.kx[3] = 57;
+ key4.ky[3] = 27;
+
+ key5.kx[3] = 69;
+ key5.ky[3] = 23;
+}
+
+// trap positions for level 4
+void Levels::trap_pos4()
+{
+ trap1.tx[3] = 54;
+ trap1.ty[3] = 27;
+
+ trap2.tx[3] = 66;
+ trap2.ty[3] = 23;
+
+ trap3.tx[3] = 61;
+ trap3.ty[3] = 27;
+
+ trap4.tx[3] = 73;
+ trap4.ty[3] = 23;
+
+ trap5.tx[3] = 52;
+ trap5.ty[3] = 7;
+}
+
+// enemy positions for level 4
+void Levels::enem_pos4()
+{
+ enem1.ex[3] = 49;
+ enem1.ey[3] = 5;
+ enem1.d[3] = 33;
+ enem1.v[3] = 1;
+
+ enem2.ex[3] = 30;
+ enem2.ey[3] = 5;
+ enem2.d[3] = 42;
+ enem2.v[3] = 1.25;
+
+ enem3.ex[3] = 35;
+ enem3.ey[3] = 5;
+ enem3.d[3] = 20;
+ enem3.v[3] = 1;
+}
+
+// block positions for level 4
+void Levels::block_pos4()
+{
+ sol1.bx[3] = 15;
+ sol1.by[3] = 39;
+
+ sol2.bx[3] = 30;
+ sol2.by[3] = 31;
+
+ sol3.bx[3] = 15;
+ sol3.by[3] = 23;
+
+ sol4.bx[3] = 0;
+ sol4.by[3] = 8;
+
+ sol5.bx[3] = 0;
+ sol5.by[3] = 16;
+}
+
+// sinking block positions for level 4
+void Levels::soft_pos4()
+{
+ sof1.sx1[3] = 12;
+ sof1.sy[3] = 16;
+ sof1.sx2[3] = 24;
- sof4.sx1[2] = 0;
- sof4.sy[2] = 0;
- sof4.sx2[2] = 0;
-
- sof5.sx1[2] = 0;
- sof5.sy[2] = 0;
- sof5.sx2[2] = 0;
-}
+ sof2.sx1[3] = 72;
+ sof2.sy[3] = 10;
+ sof2.sx2[3] = 84;
+}
\ No newline at end of file