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! / How do I animate sprites

Author
Message
D18AGON
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 25th Sep 2004 11:55
Hi I am new to this, this is my first steps. How do sprites work? I need good step by step directions on how to load a sprite and how to attach the images in a way that will make it animate, and also how to actually make it animate, I don't see an animate sprite command in the help files, I am really at a loss on how to do this. If you could also tell me how I can get the sprite to move across the screen as he walks that would be usefull.
D18AGON
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 25th Sep 2004 14:16
I have 5 seperately drawn images ready to make into a sprite animation I drew in art dabbler then saved into dark basic media files. Not sure what to do next to make sprite animation, need help plz.
D18AGON
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 25th Sep 2004 18:49
Ok, I found out how to succesfuly animate a sprite, now what I need to know is how to set the speed of the sprite anim, please tell me what to type and where to type it in this source code I have put here so I can set the speed, cos I don't know.
Also how can I make the sprite move accross the screen as it is animated so I can do walking/traveling, plz show snippet of source code that is as simple as can be.
I'd better ask this too, how do I make A background scroll up, down,left,right,diagonaly, any direction. Plz help begginer if you can.
Mystyk
21
Years of Service
User Offline
Joined: 30th Aug 2004
Location:
Posted: 26th Sep 2004 05:48 Edited at: 26th Sep 2004 05:50
I'm trying to animate my sprites in DBPro using the "CREATE ANIMATED SPRITE" and "PLAY SPRITE" commands. Any luck on using these?

If you aren't doing it that way, then you can simply add a "WAIT" command in your loop for a delay. Like this:



This code assumes you have 5 "frames" of animation stored in 5 images. The SET SPRITE command then changes the image of the sprite, in effect generating animation. The WAIT 50 is supposed to wait 50ms before continuing, but I find that it waits a lot longer than a ms. You can change this value to get your delay correct.

Hope this helps! I could not get your source to open.
D18AGON
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 26th Sep 2004 15:06
I know how to get a sprite to animate, what i need to know now is how ti set the speed, here is my code (that works), where and what would i type into this to set speed?

sync on
Load Image "Image 1.bmp",1
Load Image "Image 2.bmp",2
Load Image "Image 3.bmp",3
Load Image "Image 4.bmp",4
Load Image "Image 5.bmp",5


do
inc n
if n > 5 then n = 1
sprite 1,x,y,n

sync

Loop

Agent
21
Years of Service
User Offline
Joined: 7th Sep 2004
Location: Sydney, Australia
Posted: 27th Sep 2004 04:14
I'm using this format myself (multiple BMP's) for my latest project, and it seems to work well.

I'm delaying the animation using a simple counter. Here's some swaydo code for you (did anybody get that joke? Old programmer school joke).



In this method, the threshold is the number of iterations between frame updates; the higher the threshold value the slower the animation. I've used this method in my project and it works perfectly.
D18AGON
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 27th Sep 2004 16:15
Isn't their a simpler command to set the speed of the sprite anim like "set sprite speed 1,20" that I could type in somrwhere?

I also need to know how to set where the starting position on the screen the sprite will load.

I also need to know how to make program that loads up a sprite anim and plays it when I press an assighned button. for egg.
"If right key then play sprite 1" Help us out. After I got this worked out then I'm moving on to collision.
Game pro
22
Years of Service
User Offline
Joined: 21st Mar 2004
Location: Usa
Posted: 30th Sep 2004 14:50
Can you tell me where i can download Art dabbler?

I am a newb at DbasicPro creator.
D18AGON
21
Years of Service
User Offline
Joined: 25th Sep 2004
Location:
Posted: 12th Oct 2004 14:59
You might be able to get it with the Acecad graphics tablet, a good quality graphics tablet at a low price. (hardware form) At least you can in my world.

Login to post a reply

Server time is: 2026-06-11 21:23:30
Your offset time is: 2026-06-11 21:23:30