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 / Speed at which a sprite animates

Author
Message
The Guardian
15
Years of Service
User Offline
Joined: 13th Sep 2009
Location:
Posted: 13th Sep 2009 11:33
Hello everyone. I realize requesting help as a first post may not be the best way to make a first impression, but I am in need of assisstance.

You see, I've found tutorials online that require for a sprites animation to be slower, that more frames be loaded. I don't have to be a professional to know this sounds like a horrible idea.

Is there a way that I can make the speed of an animation, such as walking, attacking, or being struck, slower than merely adding more of the same frames?
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Sep 2009 20:21
If you're talking about making a sprite animation using the CREATE ANIMATED SPRITE command the speed of the animation is in the PLAY SPRITE command.

Quote from the help files:
Quote: "PLAY SPRITE
This command will play an animated sprite.

Syntax

PLAY SPRITE Sprite Number, Start Frame, End Frame, Delay Value

Parameters

Sprite Number
Integer
The sprite number

Start Frame
Integer
The command defines the start frames to be played. These frames must have been previously set up using the CREATE ANIMATED SPRITE command

End Frame
Integer
The command defines the end frames to be played. These frames must have been previously set up using the CREATE ANIMATED SPRITE command

Delay Value
Integer
The Delay Value specifies the delay factor between animating frames. A low value is fast, a high value is slow
"


The delay value in PLAY SPRITE determines in milliseconds when the next frame will show (1000 milliseconds is 1 second).

If you grab the frames manually you use a timer to determine when to change the image on the sprite. Here's a simple timer:



Mulderman
20
Years of Service
User Offline
Joined: 8th Jan 2004
Location: C:\\
Posted: 13th Sep 2009 20:37 Edited at: 13th Sep 2009 20:38
My thanks goes to Grog Grueslayer.

I managed to get plain texture animation to work with your timer code.


I think i must post a code snippet in the forum here.

New GTA2 Map Editor :: http://www.gta2madness.co.cc
The Guardian
15
Years of Service
User Offline
Joined: 13th Sep 2009
Location:
Posted: 14th Sep 2009 09:38
I'm afraid, Grog Grueslayer, that it doesn't use that exact way of animating.

http://www.youtube.com/watch?v=Wt5VSTotqB4&feature=channel_page

This tutorial, not made by myself, shows how I animate my sprites, as that's how I learned, by watching this video.

Although, is the way you've posted the better way to animate? If so, I'll just do that.

Login to post a reply

Server time is: 2024-11-25 01:53:29
Your offset time is: 2024-11-25 01:53:29