First Commit
This commit is contained in:
19
Entity.cpp
Normal file
19
Entity.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user