mirror of
https://github.com/stevenhowes/TheEscape.git
synced 2026-05-27 00:03:25 +01:00
Keep player ship within bounds of screen
This commit is contained in:
@@ -493,11 +493,19 @@ DEF PROCinputs
|
||||
ShipSprite$ = "player_shipr"
|
||||
ResetShipSprite% = Cents% + 20
|
||||
PlayerLocation%(0) = PlayerLocation%(0) + (XMovePerCent% * (Cents% - LastCents%))
|
||||
IF PlayerLocation%(0) > (SCREENGFXWIDTH% - PlayerHitbox%(2)) THEN
|
||||
PlayerLocation%(0) = (SCREENGFXWIDTH% - PlayerHitbox%(2))
|
||||
ShipSprite$ = "player_ship"
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF INKEY(-26) THEN
|
||||
ShipSprite$ = "player_shipl"
|
||||
ResetShipSprite% = Cents% + 20
|
||||
PlayerLocation%(0) = PlayerLocation%(0) - (XMovePerCent% * (Cents% - LastCents%))
|
||||
IF PlayerLocation%(0) < 0 THEN
|
||||
PlayerLocation%(0) = 0
|
||||
ShipSprite$ = "player_ship"
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF INKEY(-58) THEN
|
||||
PlayerVelocity% = PlayerVelocity% + 1
|
||||
|
||||
Reference in New Issue
Block a user