Prev: 6E92 Up: Map Next: 6EAB
6E9C: Create explosion fragment at coordinates
Called when an enemy is destroyed or the player collides. Sets up explosion state and adds an explosion entry to the explosions set at exploding_fragments.
  • Sets CONTROLS_BIT_EXPLODING to trigger explosion sound
  • Clears CONTROLS_BIT_FIRE_SOUND to stop the fire sound during explosion
  • Resets explosion_counter (explosion counter) to EXPLOSION_SOUND_TICKS
  • Falls through to add_object_to_set to add explosion to set
Input
BC Fragment coordinates: B=Y offset, C=X position
D Initial explosion frame index (0 = start at frame 1)
spawn_explosion_fragment 6E9C LD HL,$6BB0 Set CONTROLS_BIT_EXPLODING in state_controls.
6E9F SET 5,(HL)
6EA1 RES 0,(HL) Clear CONTROLS_BIT_FIRE_SOUND.
6EA3 LD A,$18 Reset explosion counter.
6EA5 LD ($6C7A),A
6EA8 LD HL,$5F2E Point HL to explosions set at exploding_fragments, fall through to add_object_to_set.
Prev: 6E92 Up: Map Next: 6EAB