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
Gameengine.cpp
- Committer:
- el17arm
- Date:
- 2019-03-30
- Revision:
- 16:8384e9a480ef
- Parent:
- 15:2bda80896a84
- Child:
- 17:b4079bd0e551
File content as of revision 16:8384e9a480ef:
#include "Gameengine.h"
Gameengine::Gameengine()
{
}
Gameengine::~Gameengine()
{
}
void Gameengine::game_init()
{
_level_select = 1;
_miner.miner_init(3, 33);
}
void Gameengine::read_direction(Gamepad &pad)
{
_d = pad.get_direction();
}
void Gameengine::update(N5110 &lcd, Gamepad &pad)
{
_miner.miner_move(_d);
_miner.miner_gravity(lcd);
_miner.miner_jump(lcd, pad);
_miner.miner_land(lcd);
}
void Gameengine::draw(N5110 &lcd)
{
if (_level_select == 1){
_miner.miner_draw(lcd);
_level.level_one(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);
_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);
_miner.level_one_collision(lcd);
_level.draw_key(79, 12, lcd);
}
}