Library containing the Game Engine

GameEngine.cpp

Committer:
ll14c4p
Date:
2017-04-28
Revision:
1:13a97de95e46
Parent:
0:5997fa876927
Child:
2:3b1d8ac1aac1

File content as of revision 1:13a97de95e46:

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

}

void GameEngine::get_pos()
{
    Vector2D player_pos = _p.get_pos();
    printf("yolo swag %f %f \n", player_pos.x, player_pos.y); //top left of player sprite
    
    }