Flip coin animation
patapple
Member Posts: 873
hi,
I'm trying to create an animation of a coin that flip continuously but i have no idea how to do that. I'm using illustrator and this is my coin. any help is appreciated!
http://img155.imageshack.us/img155/1638/coinq.png
I'm trying to create an animation of a coin that flip continuously but i have no idea how to do that. I'm using illustrator and this is my coin. any help is appreciated!
http://img155.imageshack.us/img155/1638/coinq.png
Best Answers
-
LumpApps Posts: 2,881Out of my head because I am on my iPhone.
You could use this illustration without the shadow as an actor.
Then in the actor ad the following.
Constrain self.size.height to (1+(sin(self.time%360*z)/2))*64
z is a value that you can change to speed it up. So it can be any number depending on the speed you want. A higher number speeds up the rotation.
In this case 64 is the height/width of your coin. If your height/width is 32px then use 32 for example.
I hope there is no error in this. Otherwise let me know. (use my name with @ so I get a notice in your reply. -
jckmcgraw Posts: 647@LudwigHeijden
Would you mind explaining that formula for me? Looks like a great effect, but how the heck did you come up with that?
Thanks,
Jack McGraw -
LumpApps Posts: 2,881Yeah, I was on my iPhone so had to do it out of my had which isn't recommended at my age
Here is a new formula, this one should work.
(1+sin( self.Time %360*700))*32
700 is the speed and 32 the height.
Here is an example project:
http://dl.dropbox.com/u/21686348/flippingCoin.gameproj.zip
Answers
the coin doesn't collide with the main character and I don't know why!
thanks a lot
It might not work when using a rule because GS thinks the coin doesn't have any height. -sigh-
In that case animating is a better option.
I made a flippping disk animation a while back:
http://dl.dropbox.com/u/21686348/coinflip.zip
You may use this free. A credit in your game would be nice
I hope you are good at photoshop so you can paste your coin design into it.
Good luck!
Lump Apps and My Assets
For sure a credit in my game will be to all the forum! ahahah
Lump Apps and My Assets
I forgot to explain the formula.
Its pretty easy. I don't know if you know anything about trigonometry but here is an explanation on that: http://en.wikipedia.org/wiki/Sine
It's not so complicated. But I am not good at explaining. Perhaps someone else can??
Lump Apps and My Assets
I just learned basic trigonometry this year (8th grade geometry), and we haven't applied it to many situations.
Thanks for the help though!
Jack McGraw
Lump Apps and My Assets