test 1 doc

Dependencies:   mbed Gamepad2

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)
{
}

*/