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-12
- Revision:
- 37:4d525a37d5d2
- Parent:
- 34:c5a042973e0c
- Child:
- 38:55bb9da08a52
File content as of revision 37:4d525a37d5d2:
#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)
{
    _sprites.soft_blocks(46, 8, lcd);
    _sprites.soft_blocks(52, 8, lcd);
    _sprites.soft_blocks(55, 36, lcd);
    _sprites.soft_blocks(33, 8, lcd);
    _sprites.soft_blocks(27, 8, lcd);
    _sprites.soft_blocks(59, 36, lcd);
    
    printf("trap1 x %f \n", trap1.ty);
}
int Level1::keys_collected()
{
    
    int k =_sprites.keys_collected();
    return k;
}
bool Level1::level1_exit(N5110 &lcd)
{
    if(_sprites.exit_level(78,41,lcd) == true) {
        return true;
    } else {
        return false;
    }
}
void Level1::trap_pos()
{
    trap1.tx = 25;
    trap1.ty = 44;
    
    trap2.tx = 58;
    trap2.ty = 6;
    
    trap3.tx = 75;
    trap3.ty = 6;
    
    trap4.tx = 23;
    trap4.ty = 6;
}
void Level1::key_pos()
{
    key1.k = 0;
    key1.kx = 79;
    key1.ky = 12;
    
    key2.k = 1;
    key2.kx = 36;
    key2.ky = 22;
    
    key3.k = 2;
    key3.kx = 40;
    key3.ky = 6;
    
    key4.k = 3;
    key4.kx = 62;
    key4.ky = 6;
    
    key5.k = 4;
    key5.kx = 75;
    key5.ky = 0;
}