Prev: 40122 Up: Map Next: 40333
40295: Update Burst Entity
Updates an entity of the type 7 which is made by StartBurst. It plays two clicks, and when it reaches frame 7 it hides itself and frees its slot.
Input
IX The entity
UpdateBurstEntity 40295 LD A,(24474) Fetch the low byte of the seed from RandomNumber_Seed.
40298 AND %00011111 Use bits 0-4.
40300 ADD A,80 Add 80 to make the length of the clicks.
40302 LD B,A Set the length of the clicks in B.
40303 CALL PlayClick Call PlayClick to play a click.
40306 CALL PlayClick Call PlayClick to play a click.
40309 LD A,(IX+1) Fetch the frame of the entity.
40312 AND %00011111 Keep the number of the frame.
40314 CP 7 Jump to UpdateEntity_Project to carry on updating the entity unless it is 7.
40316 JP NZ,UpdateEntity_Project
40319 LD (IX+1),128 Set the frame of the entity to 128 to hide it.
40323 CALL SetEntitySize Call SetEntitySize to set the sprite of the entity.
40326 LD (IX+0),0 Set the type of the entity to 0 to free it.
40330 JP UpdateEntity_Done Jump to UpdateEntity_Done.
Prev: 40122 Up: Map Next: 40333