simulation/Entity.cpp
2022-10-30 23:44:30 +01:00

20 lines
377 B
C++

#include "Entity.h"
#include <iostream>
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;
}
void Entity::Debug() const{
std::cout << "pos= (" << pos.x << ", " << pos.y << ")"
<< "spe= (" << spe.x << ", " << spe.y << ")"
<< "acc= (" << acc.x << ", " << acc.y << ")" << std::endl;
}