Dependencies: mbed
On Minerva
PeopleEngine/PeopleEngine.cpp
- Committer:
- el19zf
- Date:
- 2020-05-11
- Revision:
- 11:494cc44777fe
- Parent:
- 9:62d6559f0d50
- Child:
- 13:eb60628db8bf
File content as of revision 11:494cc44777fe:
#include "PeopleEngine.h" PeopleEngine::PeopleEngine() { } PeopleEngine::~PeopleEngine() { } void PeopleEngine::init() { _people.init(); } void PeopleEngine::read_input(Gamepad &pad) { //directions held in an enum and magnitude in polar coordinates _d = pad.get_direction(); _mag = pad.get_mag(); //printf("velocity = %f,%f\n",_v.x,_v.y); } void PeopleEngine::update() { _people.set_velocity(_d,_mag); _people.update(); //_p=_people.get_pos(); //printf("position = %f,%f\n",_p.x,_p.y); } void PeopleEngine::draw(N5110 &lcd) { //lcd.clear(); _people.draw(lcd); lcd.drawRect(0,0,WIDTH,HEIGHT,FILL_TRANSPARENT);//help our design lcd.drawCircle(0,HEIGHT/2,6,FILL_TRANSPARENT);//destination lcd.drawCircle(WIDTH-1,HEIGHT/2,6,FILL_TRANSPARENT);//starting point } Vector2D PeopleEngine::get_pos() { _p = _people.get_pos(); return _p; }