Library containing the Game Engine

GameEngine.cpp

Committer:
ll14c4p
Date:
2017-04-24
Revision:
0:5997fa876927
Child:
1:13a97de95e46

File content as of revision 0:5997fa876927:

#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);

}