mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-26 15:53:29 +01:00
Player ship respect hitbox size.
This commit is contained in:
Binary file not shown.
+4
-4
@@ -231,9 +231,9 @@ void game_input_tick()
|
||||
Player.location.X += PLAYER_X_SPEED * (tick - lasttick);
|
||||
Player.sprite = player_shipr;
|
||||
// TODO: SHIP WIDTH
|
||||
if(Player.location.X > DISPLAY_X)
|
||||
if((Player.location.X + Player.hitbox_tr.X) > DISPLAY_X)
|
||||
{
|
||||
Player.location.X = DISPLAY_X;
|
||||
Player.location.X = DISPLAY_X - Player.hitbox_tr.X;
|
||||
Player.sprite = player_ship;
|
||||
}
|
||||
}
|
||||
@@ -243,9 +243,9 @@ void game_input_tick()
|
||||
{
|
||||
Player.location.X -= PLAYER_X_SPEED * (tick - lasttick);
|
||||
Player.sprite = player_shipl;
|
||||
if(Player.location.X < 0)
|
||||
if((Player.location.X + Player.hitbox_bl.X) < 0)
|
||||
{
|
||||
Player.location.X = 0;
|
||||
Player.location.X = 0 - Player.hitbox_bl.X;
|
||||
Player.sprite = player_ship;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user