Scrolling Game Development Kit Forum

SGDK Version 1 => General Discussion => Topic started by: billybob884 on 2005-07-30, 08:07:37 PM

Title: sprite "timing"
Post by: billybob884 on 2005-07-30, 08:07:37 PM
what was that function that told you how many frames would pass by in a sprites animation? it was something where you put in the number of frames and the speed of the animation
Title: sprite "timing"
Post by: bluemonkmn on 2005-07-31, 07:27:55 AM
Umm... SpriteTemplate.AnimSpeed determines how long each frame of a sprite animation is displayed before advancing to the next frame, but I doubt that's what you're asking because that has to do with scripting and you're posting in General, so you may have to be more specific about what you're looking for.
Title: sprite "timing"
Post by: billybob884 on 2005-07-31, 09:16:56 AM
mmm, it was just a little equation that told you, based on the sprites anim. speed and length, how many frames would pass for the animation to cycle once. like, for exanmple, i used it to figure out how long to make hte delay in a path for an explosion animation so that it would delete itsself at the end of the path, which would be hte same frame as teh end of the animation (before it looped).
it used to be on one of your documentations in sourceforge, but i havent been able to find it.
Title: sprite "timing"
Post by: bluemonkmn on 2005-07-31, 06:29:01 PM
I think it would be something like:
frames * (26 - speed)

where frames is the number of frames in the sprite state and speed is the number that shows up in the tooltip on the sprite's slider bar.

That only works if you don't have the movement speed correlated with the animation speed.