Prev: 40462 Up: Map Next: 40520
40495: Aim Flame At Player
Used by the routine at ChooseFlameDirection.
Sets the velocity of a flame so that it heads in the direction of the player: the X velocity is 192 (left) or 64 (right) and the Y velocity is set to 64 (down). If the player is above the flame then the code at AimFlameUp writes 64 to the X velocity again instead of changing the Y velocity, so the Y velocity is left as it was.
Input
IX Flame record
AimFlameAtPlayer 40495 LD A,(38661) Fetch the X position of the player from 38661.
40498 CP (IX+3) Jump to AimFlameLeft if the player is to the left of the flame.
40501 JR C,AimFlameLeft
40503 LD (IX+6),64 Set the X velocity of the flame to 64 (moving right).
This entry point is used by the routine at AimFlameLeft.
AimFlameAtPlayer_Vertical 40507 LD A,(38662) Fetch the Y position of the player from 38662.
40510 CP (IX+4) Jump to AimFlameUp if the player is above the flame.
40513 JR C,AimFlameUp
40515 LD (IX+7),64 Set the Y velocity of the flame to 64 (moving down).
40519 RET Return.
Prev: 40462 Up: Map Next: 40520