Prev: 58530 Up: Map Next: 58601
58565: Controls: Left/ Down
Used by the routine at Controls_CheckRightDown.
Did the player press diagonally left/ down?
Controls_CheckLeftDown 58565 CP 6 Jump to Controls_CheckRightUp if the player didn't press left/ down (2+4=6).
58567 JR NZ,Controls_CheckRightUp
Left/ down movement checks for boundaries and the home box.
58569 LD A,(55341) A=*DestinationCursor_X_Position.
Can the player move left?
58572 CP 5 If *DestinationCursor_X_Position is at or beyond the left-most boundary jump to MoveDown_Checks.
58574 JP M,MoveDown_Checks
Is the player about to enter the home box?
This is position 6/ 2:
cursor-06-02
58577 CP 6 If *DestinationCursor_X_Position is not 6 (which confirms the player can't be beside the home box), jump to MoveLeftDown.
58579 JR NZ,MoveLeftDown
If the horizontal co-ordinate is 6 and the vertical co-ordinate is 2 then the player IS beside the home box. We then jump to MoveLeft_Checks to handle the animation of entering the home box.
58581 LD A,(55340) Now compare *DestinationCursor_Y_Position with 2.
58584 CP 2
58586 JP Z,MoveLeft_Checks If *DestinationCursor_Y_Position is 2 (which confirms that yes, the player is beside the home box), jump to MoveLeft_Checks so this routine can handle the rest of the movement update.
Normal left movement.
58589 LD A,(55341) Reload *DestinationCursor_X_Position into A.
Note this only handles moving left, it then passes the rest of the movement to MoveDown_Checks for handling moving down.
MoveLeftDown 58592 SUB 4 Move 4 character blocks left.
58594 LD (55341),A Update *DestinationCursor_X_Position.
Update the tile ID the player has now landed on (note, this only covers the "left" movement here - the jump below covers if down should also alter the value).
58597 DEC (HL) Decrease *HL by one.
58598 JP MoveDown_Checks Jump to MoveDown_Checks.
Prev: 58530 Up: Map Next: 58601