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-09
- Revision:
- 27:e73dd64ef334
- Parent:
- 26:bce40bf4c9fc
- Child:
- 31:ed5f7f15a1ed
- Child:
- 32:5dc769ba4a58
File content as of revision 27:e73dd64ef334:
#include "Level1.h"
Level1::Level1()
{
}
Level1::~Level1()
{
}
void Level1::level_platforms(N5110 &lcd)
{
lcd.drawLine(0,47,83,47, 1);
lcd.drawRect(11,39, 38, 2, FILL_BLACK);
lcd.drawRect(65,37, 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(58,9,32,2,FILL_BLACK);
}
void Level1::soft_blocks(N5110 &lcd)
{
_level.soft_blocks(46, 8, lcd);
_level.soft_blocks(52, 8, lcd);
_level.soft_blocks(55, 36, lcd);
_level.soft_blocks(33, 8, lcd);
_level.soft_blocks(27, 8, lcd);
_level.soft_blocks(59, 36, lcd);
}
void Level1::solid_blocks(N5110 &lcd)
{
_level.draw_solid_block(49,37, lcd);
_level.draw_solid_block(52,37, lcd);
_level.draw_solid_block(45,22, lcd);
_level.draw_solid_block(42,22, lcd);
}
void Level1::keys(N5110 &lcd, Gamepad &pad)
{
_level.key_collect(0, 79, 12, lcd, pad);
_level.key_collect(1, 36, 22, lcd, pad);
_level.key_collect(2, 40, 6, lcd, pad);
_level.key_collect(3, 62, 6, lcd, pad);
_level.key_collect(4, 75, 0, lcd, pad);
}
int Level1::traps(N5110 &lcd)
{
if(_level.trap(25, 45, lcd) || _level.trap(58, 7, lcd) ||
_level.trap(75, 7, lcd) || _level.trap(23,7,lcd)) {
return 1;
} else {
return 0;
}
}
int Level1::keys_collected()
{
int k =_level.keys_collected();
return k;
}
bool Level1::level1_exit(N5110 &lcd)
{
if(_level.exit_level(78,41,lcd) == true) {
return true;
} else {
return false;
}
}