Prev: 9494 Up: Map Next: 9507
94A8: Update routine for type $19, the tough attacker
Takes many hits: a shot (bit 5 of +$10) counts as one only on every eighth pass, in +$16, and a missile counts one directly (test_player_shots); each scores 75. From ten hits it flashes white (+$D = $FF instead of $55), and at fourteen it explodes, scored. It has an engine sound (sound_hum), drops things on the ship (attacker_fires, kind 7 or 8 by its facing), changes course now and then (change_course, steer_tough_attacker), faces the way it moves, and moves bouncing in a 48 by 24 box.
Input
IX The record
update_tough_attacker 94A8 CALL sound_hum Engine sound; its colour
94AB LD (IX+$0D),$55
94AF BIT 5,(IX+$10) Shot, on every eighth pass: one more hit, a sound, 75 points
94B3 JR Z,update_tough_attacker_0
94B5 LD A,(pass_counter)
94B8 AND $07
94BA JR NZ,update_tough_attacker_0
94BC INC (IX+$16)
94BF CALL score_object
94C2 CALL sound_zap
update_tough_attacker_0 94C5 RES 5,(IX+$10) The shot is used up
94C9 LD A,(IX+$16) Ten hits: flashing white
94CC AND $3F
94CE CP $0A
94D0 JR C,update_tough_attacker_1
94D2 LD (IX+$0D),$FF
update_tough_attacker_1 94D6 CP $0E Fourteen: it explodes, scored
94D8 JR C,update_tough_attacker_2
94DA SET 3,(IX+$17)
94DE CALL score_object
update_tough_attacker_2 94E1 PUSH IY Drop something on the ship
94E3 LD A,(IX+$13)
94E6 AND $01
94E8 ADD A,$07
94EA LD (scratch_count),A
94ED CALL attacker_fires
94F0 POP IY
94F2 CALL change_course Change course now and then; accelerate
94F5 CALL accelerate
94F8 LD A,(IX+$07) Face the way it moves
94FB OR (IX+$08)
94FE CALL NZ,set_facing
9501 LD BC,$1830 48 by 24; move and draw
9504 JP move_draw
Prev: 9494 Up: Map Next: 9507