Prev: 903D Up: Map Next: 909A
9056: Nudge Object
Moves an object by a small fixed amount in two steps, by temporarily replacing its speeds and calling MoveObject. Purpose of the call to CheckTerrainCollision in between not yet known.
Input
IX Address of the object
NudgeObject 9056 LD A,$04 Set the displacement to four.
9058 PUSH BC Stash BC on the stack.
9059 CALL NudgeObject_Step Move the object.
905C POP BC Bring BC back off the stack.
905D CALL CheckTerrainCollision Call CheckTerrainCollision.
9060 LD A,$FC Set the displacement to FC.
NudgeObject_Step 9062 LD H,(IX+$07) Save the horizontal speed of the object in ScrollWorld_Record.
9065 LD L,(IX+$08)
9068 LD ($DEDC),HL
906B LD H,(IX+$09) Save the vertical speed of the object in DEDE.
906E LD L,(IX+$0A)
9071 LD ($DEDE),HL
9074 LD (IX+$09),A Set the vertical speed to the displacement.
9077 LD (IX+$0A),$00 Clear the low byte of the vertical speed.
907B NEG Negate the displacement.
907D LD (IX+$07),A Set the horizontal speed to the displacement.
9080 LD (IX+$08),$00 Clear the low byte of the horizontal speed.
9084 CALL MoveObject Update the position of the object.
9087 LD HL,($DEDC) Restore the horizontal speed of the object.
908A LD (IX+$07),H
908D LD (IX+$08),L
9090 LD HL,($DEDE) Restore the vertical speed of the object.
9093 LD (IX+$09),H
9096 LD (IX+$0A),L
9099 RET Return.
Prev: 903D Up: Map Next: 909A