Prev: 59605 Up: Map Next: 59689
59630: MOVE spell continued - set viewport scenery speed/movement based on Maroc's
Used by the routine at 59605.
This routine sets the general room/viewport movement based on Maroc's updated vertical/horizontal movement speed.
Although the game gives the effect of Maroc moving, he's not; it's actually every other graphic item that's moving in the opposite direction, so we need to change the room position based on the NEGative of Maroc's speed/direction.
First, check if Maroc is in a vertical scrolling tunnel:
59630 LD A,(60087) Get the current room number
59633 CP 224 If >=224, Maroc is in a vertically scrolling tunnel
59635 JR NC,59683
Maroc is in a standard room, not a vertical tunnel:
59637 LD E,90 Default vertical pixel position of the room
59639 LD (60234),A Store room number
59642 LD A,28
59644 LD (60232),A Default horizontal position of the room, in half character (4 pixel) steps
59647 LD A,(60164) Calculate and store NEGative value of Maroc's horizontal movement speed (room elements move in the opposite direction to Maroc's controlled movement)
59650 NEG
59652 LD (60236),A
59655 LD A,(60165) Calculate and store NEGative value of Maroc's vertical movement speed
59658 NEG
59660 LD (60237),A
59663 CALL 57401 Run room boundary collision check and adjustment
59666 LD A,(60237) Copy back the post-boundary check adjusted position to Maroc's vertical position
59669 NEG
59671 LD (60165),A
59674 LD A,(60236) Copy back the post-boundary check adjusted position to Maroc's horizontal position
59677 NEG
59679 LD (60164),A
59682 RET Return to the routine at 51156
Maroc is in a vertical scrolling tunnel.
The player can't alter Maroc's vertical speed - it's set at max (32):
59683 LD A,32 Set Maroc's vertical upward movement speed to maximum (32)
59685 LD (60165),A
59688 RET Return to the routine at 51156
Prev: 59605 Up: Map Next: 59689