Here is some code showing flags and arrays being used
to throw multiple rocks
Spacebar throws rock sprites
sync on
sync rate 60
global ThrowFlag=0
global RockTimer=0
global RockPtr=0
`stones(1)=active flag, 2=x, 3=y, 4=time
dim stones(100,5)
`make simple box texture
create bitmap 1,50,50
set current bitmap 1
box 0,0,20,20
Get image 1,0,0,20,20
delete bitmap 1
set current bitmap 0
`make sprites
for i=1 to 20
sprite i,100,40*i,1
next i
do
If Spacekey() = 1
t=timer() :`get time
if t>RockTimer :`can we throw another rock
ThrowStone() :`yep, throw rock
RockTimer=t+100 :`timer until we can throw again
endif
endif
AnimateStones()
`debug code
set cursor 0,0
print "throwflag=";throwflag
print "rockptr=";RockPtr
sync
loop
Function ThrowStone()
`is a rock ready to throw, then load params for this stone into array
if ThrowFlag=0
inc RockPtr,1
if RockPtr>100 then RockPtr=1
stones(RockPtr,1)=1 :`active rock
stones(RockPtr,2)=100 :`x position
Stones(RockPtr,3)=40*RockPtr :`y position
stones(RockPtr,4)=Timer()+5000 :`rocks will last for 5 seconds
show sprite RockPtr
ThrowFlag=1
Endif
Endfunction
Function AnimateStones()
t=timer()
if t>RockTimer then ThrowFlag=0 :`if it has been long anough, enable another rock can be thrown
for i=1 to 100
if stones(i,1)>0 :`is rock active
Sprite i, stones(i,2),stones(i,3),1
inc stones(i,2),2
if stones(i,4)<t :`stone timer has run out
stones(i,1)=0 :`rock is inactive now
hide sprite i
endif
endif
next i
EndFunction