predictCollisions func added to Game.cpp
This commit is contained in:
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user