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.

DarkBASIC Professional Discussion / Play Sprite - help me please

Author
Message
Dent
23
Years of Service
User Offline
Joined: 18th Jul 2003
Location:
Posted: 31st Aug 2003 02:09
If I type something like this:
PLAY SPRITE 1, 13, 14, 500

It will play each frame from 1 to 14, and then loop between 13-14.
How do I make it play just 13-14, not 1-13?
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 31st Aug 2003 02:26
I've never really used sprites, but I'm guessing:

SET SPRITE FRAME 1,13
PLAY SPRITE 1,13,14,500

Insiiiiiiiiiiiiiiiiiiiiiiiide!
Dent
23
Years of Service
User Offline
Joined: 18th Jul 2003
Location:
Posted: 31st Aug 2003 02:28
Good guess, but already tried that
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 31st Aug 2003 02:38 Edited at: 31st Aug 2003 02:39
Hmmm.

Only other suggestion would be for you to handle all the images manually, so just use sprite and set sprite image commands, coupled with your own animation delay code. Not ideal, but I cant see any other solution.

Hopefully some 2D guru will help you out.

Insiiiiiiiiiiiiiiiiiiiiiiiide!
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 31st Aug 2003 03:12
Play sprite appears to be a bit dodgy in more ways than one. the from and to frames in play sprite command are 1 out. i.e yoy say you want frames 7-10 but it will play 8-11. If your anim has 20 frames and you specify frames 17 to 20 it will cycle from 18-20 and frame 1.

looks like play sprite goes from 'current' frame as set by set sprite frame, through to 'end' frame, then cycles back to 'start' frame. i.e. start frame is only looked at when anim reaches end.

Hope that makes sense.

So in your example, if you want frames 13 and 14, then set sprite frame to 12 and play sprite from 12 to 13

I am knocking up an official bug post now to make it clear to mods and lee.

The programmer formerly known as sonic

Login to post a reply

Server time is: 2026-07-25 02:09:25
Your offset time is: 2026-07-25 02:09:25