Page 1 of 1

Multi frame sprite question

Posted: Mon Jun 01, 2015 9:43 pm
by Operator
Why do multi frame sprites need at least
an empty (loop: goto loop) structure to work?

Code: Select all

REM Sprite multi frame test

SPRITE "kn" LOAD "Examples/9. Sprites/knight6.png",6,1
SPRITE "kn" AT 40,40 SCALE 1
SPRITE "kn" DELAY 0.1
SPRITE "kn" SHOW
SPRITE "kn" LOOP

'sprite will only loop with this loop (?)
'if you comment out, then just first frame
'is shown and program finishes
LOOP:
GOTO LOOP

'sprite will only loop for 1 second (?)
'comment out to test
'FOR i = 1 TO 10
'  PAUSE 0.1
'NEXT i

Re: Multi frame sprite question

Posted: Mon Jun 01, 2015 9:46 pm
by Mr. Kibernetik
Multiframe sprite is animating only while program is working.

Re: Multi frame sprite question

Posted: Tue Jun 02, 2015 4:14 pm
by Operator
OK, thanks for confirming.
(I didn't understand why my minimal
snippet didn't work till I added a loop)