This subroutine only makes it to the first line and then goes to 'endof' below. Why doesn't it go all the way through all the lines?
sprites_wanted = 8
gosub makesprites
{infinite looping and sync is here and displays the sprites..
makesprites:
for sp = 1 to sprites_wanted
x = random( 1, 1250)
if x < 9 then createsprite (sp, 26) : goto endof
if x < 12 then createsprite (sp, 25) : goto endof
if x < 16 then createsprite (sp, 24) : goto endof
if x < 23 then createsprite (sp, 23) : goto endof
if x < 54 then createsprite (sp, 22) : goto endof
if x < 105 then createsprite (sp, 21) : goto endof
if x < 148 then createsprite (sp, 20) : goto endof
if x < 166 then createsprite (sp, 19) : goto endof
if x < 168 then createsprite (sp, 18) : goto endof
if x < 187 then createsprite (sp, 17) : goto endof
if x < 214 then createsprite (sp, 16) : goto endof
if x < 240 then createsprite (sp, 15) : goto endof
if x < 251 then createsprite (sp, 14) : goto endof
if x < 273 then createsprite (sp, 13) : goto endof
if x < 334 then createsprite (sp, 12) : goto endof
if x < 382 then createsprite (sp, 11) : goto endof
if x < 407 then createsprite (sp, 10) : goto endof
if x < 505 then createsprite (sp, 9) : goto endof
if x < 628 then createsprite (sp, 8) : goto endof
if x < 651 then createsprite (sp, 7) : goto endof
if x < 723 then createsprite (sp, 6) : goto endof
if x < 757 then createsprite (sp, 5) : goto endof
if x < 764 then createsprite (sp, 4) : goto endof
if x < 804 then createsprite (sp, 3) : goto endof
if x < 928 then createsprite (sp, 2) : goto endof
if x < 1250 then createsprite (sp, 1)
endof:
SetSpriteShape(sp,1)
SetSpritePhysicsOn ( sp, 2 )
SetSpritePosition ( sp, Random(10,800),Random(1,40) )
next sp
return
.