Quote: "I'm just not sure when the "else ss=0" is ever evaluated, because I saw the as long as the mouse button is held, ss keeps incrementing. But as soon as the mouse button is let go, it would never get into the "if mouseclick()=1" condition statement. Can you explain this code a little more?"
"
ss " is the name of the variable . It is like a counter that start when we mouseclick, and it reset when we release the mouse, to be ready to start again....remember that one more sprite will be create only if ss=2 ...not if ss is bigger , and the counter is always running while we press right-mouse.
This code is better.
autocam off
sync on
make object sphere 1,5
velocidad=50
spr=1
position camera -40,40,-40
point camera 0,0,0
DO
set cursor 0,0
print "Sprite ",spr
print screen fps()
`Creatin sprites with mouseclik
if mouseclick()=1
counter=counter+1
if counter=2 then create animated sprite spr,"exp35.png",6,5,1 :sprite spr,mousex()-64,mousey()-64,1:inc spr
else
counter=0 `resetting counter
endif
`Playing sprites ...we can add more than 20, it will reset sprites when we kill sprites.
for i= 1 to 20
if sprite exist(i)
play sprite i,1,30,velocidad
if sprite frame(i)=30 then delete sprite i
if spr>20 then spr=1
endif
next i
sync
LOOP
Cheers.
I'm not a grumpy grandpa