Prev: 97AE Up: Map Next: 984C
9820: Create Shot
Used by the routine at CreateSpawnedEntity.
Makes a shot at the spawn point. The shot is nudged on by three along both axes, given a random heading in the low four bits, and sent off with the moving flag set.
Input
IX The shot
CreateShot 9820 CALL PlayBriefBuzz Play the brief buzz.
9823 LD A,($5F9B) Fetch a random number.
9826 AND %00001111 Keep a heading from 0 to 15.
9828 LD (IX+$20),A Keep that heading aside.
982B LD A,(IX+$03) Nudge the low byte of the x coordinate on by three.
982E ADD A,$03
9830 LD (IX+$03),A
9833 LD A,(IX+$06) Nudge the low byte of the y coordinate on by three.
9836 ADD A,$03
9838 LD (IX+$06),A
983B CALL SetUpShotSprite Set up the shot sprite.
983E CALL FacePlayer Face the shot towards the player.
9841 LD A,(IX+$20) Fetch the heading that was kept aside.
9844 OR %10000000 Mark the shot as moving.
9846 LD (IX+$11),A Use that value as the heading.
9849 JP UpdateSpawnPoints_Advance Go on to the next spawn point.
Prev: 97AE Up: Map Next: 984C