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.

Newcomers DBPro Corner / How do I slow down a sprite?

Author
Message
roswell
21
Years of Service
User Offline
Joined: 17th Dec 2002
Location: United States
Posted: 26th Apr 2003 07:08
I have an animated sprite that only has a couple of frames, but my code is looping so quickly, you only see the last frame. Is there a way to slow down the animation without slowing down the whole game? I tried to run a loop that would just paste the same image of the sprite for half a second before pasting the next frame, but my entire game is hanging. Here's what I tried:


function explode(sprid,pointx,pointy)
slowly=timer()
stall = slowly + 500
for f=4 to 8
repeat
sprite 6,pointx-16,pointy-16,f
until slowly > stall
next f
endfunction

Is there a better way to do this, and why wouldn't the above code work?
/* You are not expected to understand this. */

Dual Athlon 2.0/1GB RAM/GeForce Ti4200-128/Win2000 Pro
Chiwawa
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Canada
Posted: 26th Apr 2003 07:40
hmmmmm..i never use ..sprite...but..

do something like that:

Login to post a reply

Server time is: 2024-09-20 05:29:09
Your offset time is: 2024-09-20 05:29:09