Prev: 9494 Up: Map Next: 9507
94A8: Update Type 19 Object
The code for an object of type 19, which is run by RunObjectHandler.
Input
IX Address of the object
UpdateType19 94A8 CALL PlayMovingSound Play a sound.
94AB LD (IX+$0D),$55 Make the attribute of the object 55.
94AF BIT 5,(IX+$10) Jump to UpdateType19_Clear if bit 5 of the flags of the object is clear.
94B3 JR Z,UpdateType19_Clear
94B5 LD A,($9A64) Fetch the frame counter from FrameCounter.
94B8 AND %00000111 Keep the bottom three bits.
94BA JR NZ,UpdateType19_Clear Jump to UpdateType19_Clear if any are set.
94BC INC (IX+$16) Add one to the third state byte of the object.
94BF CALL ScoreDestroyedObject Score the points for the object.
94C2 CALL PlayHitSound Play the explosion sound.
UpdateType19_Clear 94C5 RES 5,(IX+$10) Clear bit 5 of the flags of the object.
94C9 LD A,(IX+$16) Fetch the third state byte of the object.
94CC AND %00111111 Keep the bottom six bits.
94CE CP $0A Jump to UpdateType19_Count if it is not ten or more.
94D0 JR C,UpdateType19_Count
94D2 LD (IX+$0D),$FF Make the attribute of the object FF.
UpdateType19_Count 94D6 CP $0E Jump to UpdateType19_Shoot if it is not fourteen or more.
94D8 JR C,UpdateType19_Shoot
94DA SET 3,(IX+$17) Set bit 3 of the second set of flags of the object.
94DE CALL ScoreDestroyedObject Score the points for the object.
UpdateType19_Shoot 94E1 PUSH IY Stash IY on the stack.
94E3 LD A,(IX+$13) Fetch the first state byte of the object.
94E6 AND %00000001 Keep bit 0.
94E8 ADD A,$07 Add seven.
94EA LD ($5C1C),A Store it in ScratchValue.
94ED CALL FireRandomShot Fire a random shot.
94F0 POP IY Bring IY back off the stack.
94F2 CALL RunObjectBehaviour Run the behaviour code for the object.
94F5 CALL AccelerateObject Move the object.
94F8 LD A,(IX+$07) Fetch the horizontal speed of the object.
94FB OR (IX+$08) Combine it with the low byte of the speed.
94FE CALL NZ,SetFacing Set the facing of the object if it is moving.
9501 LD BC,$1830 BC=1830.
9504 JP UpdateType14_Move Jump to UpdateType14_Move.
Prev: 9494 Up: Map Next: 9507