| jetpac | Routines | 
| Prev: 6874 | Up: Map | Next: 68d8 | 
  | 
||||||||
| 687a | ld hl,$5dcb | Increment current alien number | ||||||
| 687d | inc (hl) | |||||||
| 687e | ld c,(ix+$04) | C=explosion animation frame | ||||||
| 6881 | ld b,(ix+$05) | B=explosion animation state | ||||||
| 6884 | ld a,($5dcc) | Game timer | ||||||
| 6887 | and b | |||||||
| 6888 | jr nz,$688d | Increment frame if timer&state is zero | ||||||
| 688a | inc (ix+$04) | |||||||
| 688d | ld a,c | A=original frame count | ||||||
| 688e | sla c | Multiply by 2 (addresses are two-bytes) | ||||||
| 6890 | ld b,$00 | |||||||
| 6892 | ld hl,$68d8 | HL=explosion sprite lookup table | ||||||
| 6895 | add hl,bc | Set offset | ||||||
| 6896 | ld e,(hl) | DE=address of the desired sprite | ||||||
| 6897 | inc hl | |||||||
| 6898 | ld d,(hl) | |||||||
| 6899 | ld l,(ix+$01) | Set HL to Y,X coords of sprite | ||||||
| 689c | ld h,(ix+$02) | |||||||
| 689f | cp $06 | Comparing with original frame count from 687e | ||||||
| 68a1 | jr nc,$68b7 | If original frame >= 6 then animation has finished | ||||||
| 68a3 | cp $03 | |||||||
| 68a5 | jr nc,$68d2 | If original frame >= 3 then half animated | ||||||
| 68a7 | call $7263 | Erase animation sprite | ||||||
| 68aa | ld a,($5dce) | A=random number | ||||||
| 68ad | and $07 | |||||||
| 68af | or $42 | |||||||
| 68b1 | ld (ix+$03),a | Update colour attribute to a random colour | ||||||
| 68b4 | jp $7197 | Colourize the sprite | ||||||
| 
 
After an explosion, we check if it was the player that died!
 
 | 
||||||||
| 68b7 | ld a,(ix+$06) | Update anim object so "animating" = "direction"? | ||||||
| 68ba | ld (ix+$00),a | |||||||
| 68bd | call $72ef | Update Actor position direction | ||||||
| 68c0 | call $726d | Find and destroy actor | ||||||
| 68c3 | ld (ix+$00),$00 | Reset "animating" | ||||||
| 68c7 | ld a,(ix+$06) | Animation object "direction" | ||||||
| 68ca | and $3f | |||||||
| 68cc | cp $03 | |||||||
| 68ce | jp c,$60b7 | Player was killed if < 3 (end of turn) | ||||||
| 68d1 | ret | |||||||
| 
 
Called when half the explosion has been animated.
 
 | 
||||||||
| 68d2 | call $71f2 | Get sprite screen position | ||||||
| 68d5 | jp $7270 | Erase a destroyed actor | ||||||
| Prev: 6874 | Up: Map | Next: 68d8 |