Prev: 47079 Up: Map Next: 47119
47085: Handle Fire Moving East West
Handles a fire that moves to and fro along the X axis at a speed of 2, turning round when it hits something.
Input
IX Address of the fire object
Move along X and turn if the fire hits something.
HandleFireMovingEastWest 47085 CALL SetPixelAdjustments_Ball Set the pixel adjustments of a ball.
47088 LD (IX+11),1 Set the speed in Z to 1, so that the fire does not fall.
47092 BIT 0,(IX+13) Test whether the fire is heading east.
47096 LD A,2 Set the speed to 2.
47098 JR NZ,HandleFireMovingEastWest_Speed Jump to HandleFireMovingEastWest_Speed if it is.
47100 NEG Make the speed negative.
HandleFireMovingEastWest_Speed 47102 LD (IX+9),A Set the speed in X of the fire.
47105 CALL PlaySoundFromXPosition Play the sound of a block moving along the X axis.
47108 CALL ApplyGravityAndMove Apply gravity to the fire and move it.
47111 BIT 0,(IX+12) Test whether the fire has hit something along the X axis.
47115 LD A,1 Set the direction bit to flip to bit 0.
47117 JR HandleFire_Turn Jump to HandleFire_Turn.
Prev: 47079 Up: Map Next: 47119