Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / sprite,animimation,loop problem

Author
Message
ThE KoRn
20
Years of Service
User Offline
Joined: 12th Oct 2002
Location:
Posted: 27th Dec 2002 04:19
do
rem walk
load image "char.bmp",2
load image "char.bmp",3
load image "char.bmp",4
load image "char.bmp",6
load image "char.bmp",7
load image "char2.bmp",8
load image "char2.bmp",9
load image "char2.bmp",10
load image "char2.bmp",11

walk=walk+1
if walk=12 then walk=2
sprite 1,x,y,walk
gosub loopc
sync
loop


this is a code based on moggie 100's code
the problem is i want the code to loop for a certain amount of times but the problem is i dont know how .
pls send a reply because my brain herts.
Kentaree
20
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 29th Dec 2002 23:50
use a for...next loop
for example, if you want the loop to go 20 times use:



Whatever I did I didn't do it!
warzog
20
Years of Service
User Offline
Joined: 13th Oct 2002
Location: United States
Posted: 11th Jan 2003 09:37
Change that to a subroutine, say "Walk:"
Then in the main section of your program add:

"If Action=1 then gosub Walk"

In order to control the number of times the animation is done:

"If Action=1 then A=1:gosub Walk"
"a=a+1:If a=>NUMBER OF TIMES then Action=0"

Login to post a reply

Server time is: 2022-11-29 15:49:55
Your offset time is: 2022-11-29 15:49:55