Copied this from an old space shooter game I did.
if controlkey() = 1 and bdelay >= waiting and ammo>0 then fireshot=1:bdelay=0
REM HANDLE BULLETS
_handle_bullets:
rem this checks for new bullets being created
rem nob = number of total bullets
if fireshot=1
for bt=1 to nob
if bullet(bt,1)=0 and found=0
dec ammo, 1
found=1
fireshot=0
firing=1
bullet(bt,1)=1
position object bullet(bt,2),px#,py#,0
show object bullet(bt,2)
play sound 2
shotz#=shotz#+1
endif
next t
found=0
endif
rem this handles movement of current bullets on the screen
if firing=1
anything_alive=0
for bt=1 to nob
if bullet(bt,1)=1
bx#=object position x(bullet(bt,2))
by#=object position y(bullet(bt,2))
position object bullet(bt,2),bx#+bullet_speed#,by#,0
gosub _bullet_collision
endif
anything_alive=anything_alive+bullet(bt,1)
next t
endif
if anything_alive=0 then firing=0
return
Your signature has been erased by a mod because it's larger than 600x120...