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
Level1/Level1.cpp
- Committer:
- el17arm
- Date:
- 2019-04-16
- Revision:
- 41:0cf320f73424
- Parent:
- 40:913339e324b8
File content as of revision 41:0cf320f73424:
#include "Level1.h"
Level1::Level1()
{
}
Level1::~Level1()
{
}
void Level1::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, 8, 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 Level1::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 Level1::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 Level1::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 Level1::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 Level1::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] = -10;
enem3.ey[0] = -10;
enem3.d[0] = 0;
enem3.v[0] = 0;
}
void Level1::level_exits(N5110 &lcd)
{
exit1.lx[0] = 78;
exit1.ly[0] = 41;
exit1.lx[1] = 70;
exit1.ly[1] = 41;
exit1.lx[2] = 70;
exit1.ly[2] = 41;
exit1.lx[3] = 70;
exit1.ly[3] = 41;
}
void Level1::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 Level1::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 Level1::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 Level1::block_pos2()
{
sol1.bx[1] = 49;
sol1.by[1] = 36;
sol2.bx[1] = 42;
sol2.by[1] = 22;
sol3.bx[1] = 42;
sol3.by[1] = 22;
sol4.bx[1] = 42;
sol4.by[1] = 22;
sol5.bx[1] = 42;
sol5.by[1] = 2;
}
void Level1::soft_pos2()
{
sof1.sx1[1] = 0;
sof1.sy[1] = 0;
sof1.sx2[1] = 0;
sof2.sx1[1] = 0;
sof2.sy[1] = 0;
sof2.sx2[1] = 0;
sof3.sx1[1] = 0;
sof3.sy[1] = 0;
sof3.sx2[1] = 0;
sof4.sx1[1] = 0;
sof4.sy[1] = 0;
sof4.sx2[1] = 0;
sof5.sx1[1] = 0;
sof5.sy[1] = 0;
sof5.sx2[1] = 0;
}
void Level1::level_platforms2(N5110 &lcd)
{
lcd.drawLine(0,47,83,47,1);
}