Prev: 51046 Up: Map Next: 51093
51052: Handle Dying
Type 9: a figure which has been shot and is falling. It subtracts byte 12 from byte 13 and adds 2 to the speed, so the figure rises and then falls, and it calls PlayShortTone. StartDying starts the speed at 250 and the height at 24. When the height is zero it makes the type 8 and sets byte 12 to 32.
Input
IX The address of the object
Turn into a body if the height is zero.
HandleDying 51052 LD A,(IX+13) Fetch byte 13.
51055 AND A Jump to HandleDying_Move if it is not zero.
51056 JR NZ,HandleDying_Move
51058 LD (IX+0),8 Make the type 8.
51062 LD (IX+12),32 Set byte 12 to 32 and return.
51066 RET
Move the figure.
HandleDying_Move 51067 SUB (IX+12) Subtract byte 12 from the height.
51070 JP M,HandleDying_Land Jump to HandleDying_Land if it is negative.
51073 LD (IX+13),A Set byte 13.
51076 CALL PlayShortTone Call PlayShortTone.
51079 LD A,(IX+12) Fetch byte 12.
51082 ADD A,2 Add 2.
51084 LD (IX+12),A Set byte 12 and return.
51087 RET
Put the figure on the ground.
HandleDying_Land 51088 LD (IX+13),0 Set byte 13 to 0 and return.
51092 RET
Prev: 51046 Up: Map Next: 51093