The Daily Click ::. Forums ::. Klik Coding Help ::. How do you make a custom animation system?
 

Post Reply  Post Oekaki 
 

Posted By Message

JetpackLover



Registered
  01/03/2007
Points
  212
3rd February, 2010 at 16:08:03 -

I ask because I want total control of my animations and I want them to be synced up with the framerate as well. I also want to be able to reverse my animation and slow it down with ease. I tried myself but I wonder if perhaps there is a better and more efficient way.

Here's an example of how I'm doing the Idle animation

This is just an example
1. X velocity = 0 > Force animation frame to Alt value Idle of ("Player")

2.Backward or forward Alt string of("Player") = "Forward" > Add 0.20 of Idle of ("Player")
+Animation stopped is playing


3.Backward or forward Alt string of("Player") = "Backward" > Subtract 0.20 of Idle of ("Player")
+Animation stopped is playing


the 0.20 is gonna be another Alterable value(Speed) so I can edit it easily and I'll be able to change the speed of my animations with ease.

This is for the loop of the animation which I'm not sure is necessary or not

Idle of ("Player") is > 7 then > set Idle of ("Player") to 0
Idle of ("Player") is < 0 then > set Idle of ("Player") to 8


I am having some issues though. Since I'm using floats for the alts and the animation frames don't operate in floats the frame will change to the next frame at for example

Alt value = 2.25 Frame anim = 3
instead I want it to be
Alt value = 2.25 Frame anim =2

and then when alt value reaches 3 it will change to 3 and stay 3 until alt value equals 4

It would be easier if the animations operated in floats too

I'm hoping there is some tutorial somewhere

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49567

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
3rd February, 2010 at 17:18:54 -

Use floor(Alterable value(speed))

The floor() function turns floats into ints.

http://en.wikipedia.org/wiki/Floor_and_ceiling_functions

Edited by UrbanMonk

 
n/a

Xgoff



Registered
  22/02/2009
Points
  135
3rd February, 2010 at 20:44:38 -


Originally Posted by UrbanMonk
The floor() function turns floats into ints.


technically (in mmf's case) it doesn't; int() does

though they both look like they give the same result and are mostly interchangeable, you sure don't want to use the wrong one when you're dividing

Edited by Xgoff

 
Image

JetpackLover



Registered
  01/03/2007
Points
  212
4th February, 2010 at 12:58:28 -

I'm not really sure I know what you guys are talking about, a little context goes a long way.

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49567

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
4th February, 2010 at 13:04:29 -


Originally Posted by DudeHuge
I am having some issues though. Since I'm using floats for the alts and the animation frames don't operate in floats the frame will change to the next frame at for example

Alt value = 2.25 Frame anim = 3
instead I want it to be
Alt value = 2.25 Frame anim =2



Use the floor() function to remove the decimal places without rounding up. The floor function you be used in the expression editor like so:

Floor(2.25) = 2
Or
Floor(Alterable Value A("animation")) = blah

 
n/a
   

Post Reply



 



Advertisement

Worth A Click