predictCollisions func added to Game.cpp

This commit is contained in:
2022-05-13 23:20:08 -04:00
parent e28a9cebdb
commit 36adcdeac7
7 changed files with 70 additions and 20 deletions

View File

@ -18,7 +18,8 @@ public:
Vector2D position;
Vector2D velocity;
Vector2D lastSafePos;
// Vector2D lastSafePos;
Vector2D tilePos;
int height = 40;
int width = 30;
@ -56,14 +57,19 @@ public:
void init() override
{
velocity.Zero();
lastSafePos.Zero();
tilePos.Zero();
// lastSafePos.Zero();
}
void update() override
{
position.x += velocity.x * speed;
position.y += velocity.y * speed;
}
void updateTilePosition(int x,int y){
tilePos.x = x;
tilePos.y = y;
}
};