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