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 / Animated Sprite Problem

Author
Message
Ole Sparky
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United States
Posted: 26th Mar 2003 04:58
How exactly do the 'Create Animated Sprites' and 'Play Animated Sprites' commands work? I don't see a way to set a number of frames or which part of the image makes up those frames in either the Command Help or the Examples. When I use the syntax:

create animated sprite 1[Command],"PlayerCar.bmp"[Filename],50[Across],90[Down],1[Image #]

...followed by...

play sprite 1[Command],1[Start Frame],2[End Frame],100[Delay]

...it doesn't work.

Syntax problem, missing command, or something else?

-Somehow I doubt tech specs matter in this case.-
#@&*(%$()!!!
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 26th Mar 2003 05:34
Be more specific than "it doesn't work" - do you get an error message?

Personally I think it's a lil funky too, so I do the animation "manually" - it takes a little bit more code but in the end it turns out nicely.

Ole Sparky
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United States
Posted: 26th Mar 2003 07:12
No, there's no 'error' message, it just doesn't display the sprite. And how would I animate the sprite manually?

#@&*(%$()!!!
Dr OcCuLt
23
Years of Service
User Offline
Joined: 27th Nov 2002
Location: a Dark Deep Dark pit, it dark in here
Posted: 26th Mar 2003 15:50
you may be copy over the SPRITE on the screen so try SET SPRITE PRIORITY 1,1 this will draw the SPRITE over evey thing elss.

--Dr 0--


Most people are other people.Their thoughts are someone else`s opinions,thier lives a mimicry,their passions a quotation
Oscar Wilde
Ole Sparky
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United States
Posted: 28th Mar 2003 00:36
Nope, that didn't work... Could someone just give me code for creating and playing a multi-frame sprite?

#@&*(%$()!!!
CloseToPerfect
23
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 28th Mar 2003 07:47
The way DBP handles animated sprites is complety different then any other language but heres a example.

set sprite 1,0,1
create animated sprite 1,"rocks.bmp",5,5,1
do
cls
play sprite 1,1,25,100
sprite 1,100,100,1
sync
loop

This will take a bitmap in this case rocks.bmp and cut into 25 little pictures 5 across and 5 down.
play sprite must be in your loop

hope it helps,
CTP

Ole Sparky
23
Years of Service
User Offline
Joined: 6th Dec 2002
Location: United States
Posted: 28th Mar 2003 14:27
Why yes, that does work! Thank you very much!

#@&*(%$()!!!
CloseToPerfect
23
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 29th Mar 2003 19:33
Your welcome.
CTP

Login to post a reply

Server time is: 2026-07-11 11:25:56
Your offset time is: 2026-07-11 11:25:56