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:
- 42:d81c008b0436
- Parent:
- 41:0cf320f73424
- Child:
- 43:1ec6b6293c6b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Levels/Levels.cpp Tue Apr 16 18:18:44 2019 +0000
@@ -0,0 +1,219 @@
+#include "Levels.h"
+
+Levels::Levels()
+{
+}
+
+Levels::~Levels()
+{
+}
+
+void Levels::level_platforms1(N5110 &lcd)
+{
+ lcd.drawLine(0,47,83,47, 1);
+ lcd.drawRect(11,39, 38, 2, FILL_BLACK);
+ lcd.drawRect(65,36, 30, 2, FILL_BLACK);
+ lcd.drawRect(75,29, 9, 2, FILL_BLACK);
+ lcd.drawRect(22, 25, 48, 2, FILL_BLACK);
+ lcd.drawRect(0, 25, 12, 2, FILL_BLACK);
+ lcd.drawRect(0, 17, 8, 2, FILL_BLACK);
+ lcd.drawRect(0, 9, 27, 2, FILL_BLACK);
+ lcd.drawRect(39, 9, 7, 2, FILL_BLACK);
+ lcd.drawRect(53,9,32,2,FILL_BLACK);
+}
+
+
+
+void Levels::trap_pos1()
+{
+ trap1.tx[0] = 25;
+ trap1.ty[0] = 44;
+ trap2.tx[0] = 58;
+ trap2.ty[0] = 6;
+ trap3.tx[0] = 75;
+ trap3.ty[0] = 6;
+ trap4.tx[0] = 0;
+ trap4.ty[0] = 0;
+ trap5.tx[0] = 25;
+ trap5.ty[0] = 36;
+}
+
+void Levels::key_pos1()
+{
+ key1.kx[0] = 79;
+ key1.ky[0] = 12;
+ key2.kx[0] = 36;
+ key2.ky[0] = 22;
+ key3.kx[0] = 40;
+ key3.ky[0] = 6;
+ key4.kx[0] = 62;
+ key4.ky[0] = 6;
+ key5.kx[0] = 75;
+ key5.ky[0] = 0;
+}
+
+void Levels::block_pos1()
+{
+ sol1.bx[0] = 49;
+ sol1.by[0] = 36;
+
+ sol2.bx[0] = 42;
+ sol2.by[0] = 22;
+
+ sol3.bx[0] = -10;
+ sol3.by[0] = -10;
+
+ sol4.bx[0] = -10;
+ sol4.by[0] = -10;
+
+ sol5.bx[0] = -10;
+ sol5.by[0] = -10;
+}
+
+void Levels::soft_pos1()
+{
+ sof1.sx1[0] = 55;
+ sof1.sy[0] = 36;
+ sof1.sx2[0] = 65;
+
+ sof2.sx1[0] = 27;
+ sof2.sy[0] = 9;
+ sof2.sx2[0] = 39;
+
+ sof3.sx1[0] = 46;
+ sof3.sy[0] = 9;
+ sof3.sx2[0] = 52;
+
+ sof4.sx1[0] = 0;
+ sof4.sy[0] = 0;
+ sof4.sx2[0] = 0;
+
+ sof4.sx1[0] = 0;
+ sof4.sy[0] = 0;
+ sof4.sx2[0] = 0;
+}
+
+void Levels::enem_pos1()
+{
+ enem1.ex[0] = 22;
+ enem1.ey[0] = 20;
+ enem1.d[0] = 36;
+ enem1.v[0] = 0.5;
+
+ enem2.ex[0] = 0;
+ enem2.ey[0] = 4;
+ enem2.d[0] = 26;
+ enem2.v[0] = 1;
+
+ enem3.ex[0] = 49;
+ enem3.ey[0] = 42;
+ enem3.d[0] = 27;
+ enem3.v[0] = 1;
+}
+
+void Levels::level_exits(N5110 &lcd)
+{
+ exit1.lx[0] = 78;
+ exit1.ly[0] = 41;
+
+ exit1.lx[1] = 79;
+ exit1.ly[1] = 41;
+
+ exit1.lx[2] = 70;
+ exit1.ly[2] = 41;
+
+ exit1.lx[3] = 70;
+ exit1.ly[3] = 41;
+}
+
+void Levels::level_platforms2(N5110 &lcd)
+{
+ lcd.drawLine(0,47,83,47,1);
+ lcd.drawRect(4,35, 12, 2, FILL_BLACK);
+
+}
+void Levels::key_pos2()
+{
+ key1.kx[1] = 10;
+ key1.ky[1] = 44;
+ key2.kx[1] = 18;
+ key2.ky[1] = 44;
+ key3.kx[1] = 22;
+ key3.ky[1] = 44;
+ key4.kx[1] = 26;
+ key4.ky[1] = 44;
+ key5.kx[1] = 30;
+ key5.ky[1] = 44;
+}
+
+void Levels::trap_pos2()
+{
+ trap1.tx[1] = 25;
+ trap1.ty[1] = 44;
+ trap2.tx[1] = 58;
+ trap2.ty[1] = 6;
+ trap3.tx[1] = 75;
+ trap3.ty[1] = 6;
+ trap4.tx[1] = 23;
+ trap4.ty[1] = 6;
+ trap5.tx[1] = -10;
+ trap5.ty[1] = -10;
+}
+
+void Levels::enem_pos2()
+{
+ enem1.f[1] = 0;
+ enem1.ex[1] = 22;
+ enem1.ey[1] = 20;
+ enem1.d[1] = 36;
+ enem1.v[1] = 0.5;
+
+ enem2.f[1] = 1;
+ enem2.ex[1] = 10;
+ enem2.ey[1] = 4;
+ enem2.d[1] = 26;
+ enem2.v[1] = 1;
+}
+
+void Levels::block_pos2()
+{
+ sol1.bx[1] = 66;
+ sol1.by[1] = 38;
+
+ sol2.bx[1] = 66;
+ sol2.by[1] = 33;
+
+ sol3.bx[1] = 66;
+ sol3.by[1] = 28;
+
+ sol4.bx[1] = 66;
+ sol4.by[1] = 23;
+
+ sol5.bx[1] = 66;
+ sol5.by[1] = 18;
+}
+
+void Levels::soft_pos2()
+{
+ sof1.sx1[1] = 72;
+ sof1.sy[1] = 38;
+ sof1.sx2[1] = 84;
+
+ sof2.sx1[1] = 72;
+ sof2.sy[1] = 33;
+ sof2.sx2[1] = 84;
+
+ sof3.sx1[1] = 72;
+ sof3.sy[1] = 28;
+ sof3.sx2[1] = 84;
+
+ sof4.sx1[1] = 72;
+ sof4.sy[1] = 23;
+ sof4.sx2[1] = 84;
+
+ sof5.sx1[1] = 72;
+ sof5.sy[1] = 18;
+ sof5.sx2[1] = 84;
+}
+
+