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/GameEngine.cpp
- Committer:
- RehamFaqehi
- Date:
- 2018-04-19
- Revision:
- 5:b230e79d36d6
- Parent:
- 4:8c6723798227
- Child:
- 6:7b733b2a6cf6
File content as of revision 5:b230e79d36d6:
#include "GameEngine.h"
GameEngine::GameEngine()
{
}
GameEngine::~GameEngine()
{
}
void GameEngine::init()
{
_rocket.init();
_asteroid.init(3);
}
void GameEngine::read_input(Gamepad &pad)
{
_d = pad.get_direction();
_mag = pad.get_mag();
}
void GameEngine::draw(N5110 &lcd)
{
// draw the game elements in the LCD
_rocket.draw(lcd);
_asteroid.draw(lcd);
}
void GameEngine::update(Gamepad &pad, N5110 &lcd)
{
_rocket.update(_d,_mag, lcd);
_asteroid.update();
}