Prev: 60165 Up: Map Next: 60301
60233: Player: Move Left
Used by the routines at PlayerControls_Kempston and PlayerControls.
Input
IX On entry will be set to TablePlayerAttributes
PlayerMoveLeft 60233 LD A,(IX+17) Return if *PlayerActionState is blocked / no walk.
60236 CP 2
60238 RET Z
60239 CP 3 Jump to PlayerMoveLeft_FaceAndWalk if *PlayerActionState is not on a ladder.
60241 JR NZ,PlayerMoveLeft_FaceAndWalk
60243 LD A,(IX+3) Return if *PlayerVerticalPosition is not 3.
60246 CP 3
60248 RET NZ
60249 LD A,255 Force *PlayerCollisionMask_Middle so the middle foot does not see a floor.
60251 LD (62253),A
60254 LD A,(IX+1) Jump to PlayerMoveLeft_FaceAndWalk if *PlayerVerticalCoordinate is at the top of the ladder.
60257 CP (IX+18)
60260 JR Z,PlayerMoveLeft_FaceAndWalk
60262 CP (IX+19) Return if *PlayerVerticalCoordinate is not at the bottom of the ladder.
60265 RET NZ
Face and walk left.
PlayerMoveLeft_FaceAndWalk 60266 LD A,(IX+17) Jump to PlayerMoveLeft_AdvanceFrame if *PlayerActionState is already facing left.
60269 CP 4
60271 JR Z,PlayerMoveLeft_AdvanceFrame
60273 LD (IX+17),4 Set *PlayerActionState to facing left.
60277 LD (IX+6),74 Write the frame before the first left-facing walk sprite to *PlayerSpriteID.
PlayerMoveLeft_AdvanceFrame 60281 LD A,(IX+6) A=*PlayerSpriteID.
60284 ADD A,6 Advance to the next left-facing walk frame.
60286 LD (IX+6),A Write it back to *PlayerSpriteID.
60289 CP 128 Jump to PlayerMoveLeft_SetDirection if the walk cycle has not wrapped.
60291 JR NZ,PlayerMoveLeft_SetDirection
60293 LD (IX+6),80 Reset *PlayerSpriteID to the first left-facing frame.
PlayerMoveLeft_SetDirection 60297 INC (IX+4) Set *PlayerHorizontalMovement to move left.
60300 RET Return.
Prev: 60165 Up: Map Next: 60301