Quote: "Are there any drawbacks of using extend?"
The only drawback is if you spell it wrong. Since we can create any variable on the fly a misspelled variable name would be zero and thus produce an error since image number zero would never exist.
I wonder if an array would give you the same problem.
` Make random number picking more random
randomize timer()
` Dimensionalize an array
dim Images(19,2)
` Create 20 random image numbers
for t=0 to 19
` Pick a random color
ink rgb(rnd(255),rnd(255),rnd(255)),0
` Make the box
box 0,0,50,50
` Pick a random image number between 1 and 1000
Img=rnd(999)+1
` Change to white
ink rgb(255,255,255),0
` Show the image number on the box
center text 25,17,str$(Img)
` Grab the image
get image Img,0,0,50,50,1
` Store the image number in the array
Images(t,0)=Img
` Pick random coordinates and put in the array
Images(t,1)=rnd(screen width())
Images(t,2)=rnd(screen height())
next t
` Create a timer
tim=timer()
do
cls
` Show the images
for t=0 to 19
paste image Images(t,0),Images(t,1),Images(t,2),1
` Move the image down the screen
inc Images(t,2)
` Check if it goes off the screen
if Images(t,2)>screen height()+50
` Pick a new x coordinate
Images(t,1)=rnd(screen width())
` Reset y coordinate
Images(t,2)=-50
endif
next t
wait 2
loop