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 / OK. Animated sprite is working but who can tell me more?

Author
Message
Matt Kitcat
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 31st Oct 2003 13:06
I have finally got my animated sprite working. does anybody know the ins and outs of the behavior?

Sprite 1,240,240,1
repeat
Play Sprite 1,6,14,12
Until Mouseclick()=1

The image has 26 "frames" according to the "help" you specify which frames are to be played. The above play sprite should therefore play frames 6 to 14 in a loop. However it plays from fram 1 to 14 then loops 6-14.
I need to know more about animated sprites but there obviously is no information with DB.
What I really need to do is this:

Press a key and trigger 25 frames of an animation.
If the key remains pressed loop some frames of animation
when the key is released play some other frames of animation.
I don't know if the frames should be in the same file or sepreate files or how to play one file after another from keypresses.
(In fact I don't know anything!)
Can anybody point me towards some informations

Thanks
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 31st Oct 2003 13:35
are you using darkbasic pro? why do you use play sprite

You cant do it if you try
Codger
22
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 31st Oct 2003 16:57 Edited at: 31st Oct 2003 16:58
If you are using DBPro look in the help section on sprites..

the command is

Quote: "create animated sprite 1, "animspr.bmp", 4, 4, 16"


the paramenters are as follows SP#,SPImageFileName,Fames Across,Frames Down,Image#

in the above example the 4 , 4 means 16 seperate frames

play sprite 1,1,16,50

parameter as follows : SP#, Start Frame, End Frame, animation speed

You do not appear to be using animated sprites

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 31st Oct 2003 18:36
Animates sprites have issues at the minute. Do a search in bugs forum and you will a few references to it. Mine being one of them.

Playing particular frames is a bit of an art form. For now you have to set start frame manually and the play sprite.

Boo!
Matt Kitcat
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 1st Nov 2003 01:33
Yes I am using dark basic pro. I understand the basics of the create animated sprite command. My bitmap is infact images in 1 line accross. there are 26 of them oops I seem to have missed out the create animated sprite 1, animspr.bmp",1, 26, 16 at the start of the section. I did it like this because i found it really hard to lay out the images in a matrix and split them up correctly so I put them in a line and it seemed to work nice and steady.
I am interested by the first reply. "why do you use play sprite?"
It says I have to in the help doesn't it?
Oh I am so confused.
set the start frame manually...er...
i think I will go to bed and wish I was young enough to ask mummy to bring me a cup of milk.

Login to post a reply

Server time is: 2024-11-25 14:49:53
Your offset time is: 2024-11-25 14:49:53