![]() |
Routines |
| Prev: B962 | Up: Map | Next: B973 |
|
Used by the routines at spark_home_in and chaser_chase.
Sets dX and dY to plus or minus the given speeds, each pointing from the object towards the player along its axis. The sign is taken from the difference, so it is right as long as the two are less than 128 apart. When they are level the object steps back the negative way, so a chaser jitters about the player rather than stopping on him.
|
||||||||||||
| move_towards_plyr | B965 | LD HL,$5C09 | own X minus the player's X | |||||||||
| B968 | LD A,(IX+$01) | |||||||||||
| B96B | SUB (HL) | |||||||||||
| B96C | INC HL | C if the player is further along X, else -C | ||||||||||
| B96D | LD A,C | |||||||||||
| B96E | JP M,towards_plyr_y | |||||||||||
| B971 | NEG | |||||||||||
| Prev: B962 | Up: Map | Next: B973 |