#include "Entity.h" #include Entity::Entity(Vec2 p, Vec2 s, Vec2 a): pos(p), spe(s), acc(a) { } void Entity::Update(){ pos = pos + spe + acc/2; spe = spe + acc; if(pos.y >= 1000){ spe.y = - spe.y + acc.y; } if(pos.x >= 1920){ pos.x = 0; } } void Entity::Debug() const{ std::cout << "pos= (" << pos.x << ", " << pos.y << ")" << "spe= (" << spe.x << ", " << spe.y << ")" << "acc= (" << acc.x << ", " << acc.y << ")" << std::endl; } Vec2 Entity::GetPos(){ return pos; }