Prev: 36925 Up: Map Next: 37018
36950: 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 36950 LD A,4 Set the displacement to four.
36952 PUSH BC Stash BC on the stack.
36953 CALL NudgeObject_Step Move the object.
36956 POP BC Bring BC back off the stack.
36957 CALL CheckTerrainCollision Call CheckTerrainCollision.
36960 LD A,252 Set the displacement to 252.
NudgeObject_Step 36962 LD H,(IX+7) Save the horizontal speed of the object in ScrollWorld_Record.
36965 LD L,(IX+8)
36968 LD (57052),HL
36971 LD H,(IX+9) Save the vertical speed of the object in 57054.
36974 LD L,(IX+10)
36977 LD (57054),HL
36980 LD (IX+9),A Set the vertical speed to the displacement.
36983 LD (IX+10),0 Clear the low byte of the vertical speed.
36987 NEG Negate the displacement.
36989 LD (IX+7),A Set the horizontal speed to the displacement.
36992 LD (IX+8),0 Clear the low byte of the horizontal speed.
36996 CALL MoveObject Update the position of the object.
36999 LD HL,(57052) Restore the horizontal speed of the object.
37002 LD (IX+7),H
37005 LD (IX+8),L
37008 LD HL,(57054) Restore the vertical speed of the object.
37011 LD (IX+9),H
37014 LD (IX+10),L
37017 RET Return.
Prev: 36925 Up: Map Next: 37018