ELEC2645 (2019/20)
/
ELEC2645_Project_el18jb
test 1 doc
Engine/Engine.cpp
- Committer:
- joebarhouch
- Date:
- 2020-05-22
- Revision:
- 5:928c2eee4109
- Parent:
- 4:cf5088ace087
- Child:
- 6:00d20886e4f8
File content as of revision 5:928c2eee4109:
#include "Engine.h" Engine::Engine() { } Engine::~Engine() { } void Engine::init() { //init coord _px = WIDTH / 2; _py = HEIGHT / 2; _plat.init(); //init call _p.init(_px, _py); } //reads direction and magnitude from the JOYSTICK to control the player void Engine::read_input(Gamepad &pad) { _d = pad.get_direction(); _mag = pad.get_mag(); } //draw both player and map void Engine::draw(N5110 &lcd) { // player _p.draw(lcd); _plat.draw(lcd); } //provide the player file with necessary Joystick values void Engine::update(Gamepad &pad) { _p.update(_d,_mag); //enemmyCollide(pad); } /* void PongEngine::check_paddle_collisions(Gamepad &pad) { } void PongEngine::print_health(N5110 &lcd) { } */