;############## Calcuzap by Patrick Davidson - hits with enemies hit_enemy: ld hl,enemies ld b,e_count loop_scan_enemies: ld a,(hl) or a jr z,no_enemy_to_hit cp 15 jr z,no_enemy_to_hit push bc push hl inc hl call set_collision_check_object ld hl,bullets ld bc,b_count*256 loop_scan_bullets: push bc push hl inc hl call collision_check pop hl pop bc jr nc,no_hit_bullet ld a,(hl) or a jr z,no_hit_bullet ld (hl),6 ; bullet being removed inc c no_hit_bullet: ld de,b_size add hl,de djnz loop_scan_bullets pop hl push hl ld de,e_dmg add hl,de ld a,(hl) sub c ld (hl),a pop hl jr nc,no_hit_enemy ld (hl),15 ; enemy being removed push hl call erase_object pop hl push hl inc hl inc hl inc hl ld de,img_enemy_explode #ifdef TI84CE ld (hl),de inc hl inc hl #else ld (hl),e inc hl ld (hl),d #endif inc hl ld (hl),2 pop hl push hl ld hl,score+6 ; and increment the score ld de,score_increment+5 ld a,(score_inc) ld (de),a inc de call Add_6_Digits_BCD pop hl no_hit_enemy: pop bc no_enemy_to_hit ld de,e_size add hl,de djnz loop_scan_enemies ret Add_6_Digits_BCD: ld b,6 loop_add_nocarry: xor a loop_add: dec hl dec de ld a,(de) adc a,(hl) sub '0' ; '0' was added twice because both ASCII cp '0'+10 jr c,loop_add_nocarry_end sub 10 ccf ld (hl),a djnz loop_add ret loop_add_nocarry_end: ld (hl),a djnz loop_add_nocarry ret score_increment: .db "000001"