![]() |
Routines |
| Prev: 25216 | Up: Map | Next: 25282 |
|
Used by the routine at MainGameLoop.
Move Percy right. Checks screen boundary and handles room transitions.
|
||||||||||
| MovePercyRight | 25250 | XOR A | Write 0 to *PercyFacingDirection (Percy is facing right). | |||||||
| 25251 | LD (24485),A | |||||||||
|
If *CarryingWormFlag is set, apply an extra boundary check.
|
||||||||||
| 25254 | LD A,(24490) | Jump to MovePercyRight_Apply if *CarryingWormFlag is unset. | ||||||||
| 25257 | OR A | |||||||||
| 25258 | JR Z,MovePercyRight_Apply | |||||||||
| 25260 | LD A,(IX+0) | Load A with Percy's X position (*IX+0) + the number of pixels to move (from D) + 4. | ||||||||
| 25263 | ADD A,D | |||||||||
| 25264 | ADD A,4 | |||||||||
|
If Percy has gone past the right edge transition into the next room.
|
||||||||||
| 25266 | CP 239 | Jump to TransitionRoomRight if Percy's new position is greater than or equal to 239. | ||||||||
| 25268 | JR NC,TransitionRoomRight | |||||||||
| MovePercyRight_Apply | 25270 | LD A,(IX+0) | Load A with Percy's X position (*IX+0) + the number of pixels to move (from D). | |||||||
| 25273 | ADD A,D | |||||||||
|
If Percy has gone past the right edge transition into the next room.
|
||||||||||
| 25274 | CP 239 | Jump to TransitionRoomRight if Percy's new position is greater than or equal to 239 (transition to next room). | ||||||||
| 25276 | JR NC,TransitionRoomRight | |||||||||
| 25278 | LD (IX+0),A | Write Percy's updated X screen position back to *IX+0. | ||||||||
| 25281 | RET | Return. | ||||||||
| Prev: 25216 | Up: Map | Next: 25282 |