Library containing the Game Engine
Diff: GameEngine.cpp
- Revision:
- 0:5997fa876927
- Child:
- 1:13a97de95e46
diff -r 000000000000 -r 5997fa876927 GameEngine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GameEngine.cpp Mon Apr 24 11:06:49 2017 +0000 @@ -0,0 +1,39 @@ +#include "GameEngine.h" + +GameEngine::GameEngine() +{ + +} + +GameEngine::~GameEngine() +{ + +} + +void GameEngine::init() +{ + +} + + + +void GameEngine::read_input(Gamepad &pad) +{ + _d = pad.get_direction(); + _mag = pad.get_mag(); +} + +void GameEngine::draw(N5110 &lcd) +{ + // draw the elements in the LCD buffer + // player + _p.draw(lcd); +} + +void GameEngine::update(Gamepad &pad) +{ + // important to update paddles and ball before checking collisions so can + // correct for it before updating the display + _p.update(_d,_mag); + +}