example
free=32
dim sprite[free]
do
//similar a timer event
y=y+1
if y=60 and free>0
for i=1 to 32
if sprite[i]=0
index=i
exit
endif
next
free=free-1
spr=createsprite(0)
SetSpriteColor(spr,random(0,255),random(0,255),random(0,255),255)
SetSpriteSize(spr,10,10)
SetSpritePositionByOffset(spr,random(5,100-5),0)
sprite[index]=spr
y=0
endif
//move all
for i=1 to 32
spr=sprite[i]
if spr<>0
SetSpritePositionByOffset(spr,GetSpriteXByOffset(spr),GetSpriteYByOffset(spr)+10.0/60.0)
endif
next
//remove outside
for i=1 to 32
spr=sprite[i]
if GetSpriteYByOffset(spr)>100+5
deletesprite(spr)
sprite[i]=0
free=free+1
endif
next
sync()
loop
AGK 108 (B)19 + AppGameKit V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)