Prev: 97DF Up: Map Next: 9837
97FF: Chase Player
Used by the routine at RunType19Behaviour.
Behaviour code used for several types of object (see RunObjectBehaviour). Makes the object accelerate towards the player and then halves the acceleration.
Input
IX Address of the object
ChasePlayer 97FF PUSH IY Stash IY on the stack.
9801 LD IY,$C8E5 Use the player's object.
9805 CALL AccelerateTowardsTarget Accelerate towards the player.
9808 POP IY Bring IY back off the stack.
980A SET 7,(IX+$16) Set bit 7 of the third state byte of the object.
980E LD H,(IX+$0B) Fetch the horizontal acceleration of the object.
9811 LD L,(IX+$0C)
9814 SRA H Halve it twice.
9816 RR L
9818 SRA H
981A RR L
981C LD (IX+$0B),H Store it.
981F LD (IX+$0C),L
9822 LD H,(IX+$0E) Fetch the vertical acceleration of the object.
9825 LD L,(IX+$0F)
9828 SRA H Halve it twice.
982A RR L
982C SRA H
982E RR L
9830 LD (IX+$0E),H Store it.
9833 LD (IX+$0F),L
9836 RET Return.
Prev: 97DF Up: Map Next: 9837