Prev: 9BDA Up: Map Next: 9D25
9D0E: Test a beam against the ship
Used by the routine at draw_beams.
Not during the launch. The beam, D pixels wide and one line high at HL, is tested against the ship's box at collision_box (test_collision_box); a touch starts 16 passes of grace (beam_grace) and damages the ship (contact_damage).
Input
HL The beam's position
D Its width in pixels
beam_hits_ship 9D0E LD A,(launch_state)
9D11 AND A
9D12 RET NZ
9D13 LD E,$01
9D15 CALL test_collision_box
9D18 LD A,(scratch_count)
9D1B AND A
9D1C RET Z
9D1D LD A,$10
9D1F LD (beam_grace),A
9D22 JP damage_ship
Prev: 9BDA Up: Map Next: 9D25