what's the best to play an animation and do some action at a specified frame?
I think the MovieClip would be the first choice if it support dispatch an event and specified frame.
And the second choice is using the Bird Animation example,but I worry about the speed.
any other choice?
Comments
but (for now i hope) movieclip is not timebased... (it's frame based)
and your animation will not be the same on different device speed
www.tntengine.com
But I will never consider to use movieclip until it support event dispatch.
For example,I can not remove the movieclip from parent after the end of animation.
https://sites.google.com/site/xraystudiogame
So yeah, you can know at what frame the animation is and do something, or if the animation has ended.
But at the moment it's available only through my Runner template (it's in the Game & Application design section of the forum). I will release it for free sooner or later, but at the moment I feel it wouldn't be right to those who just bought it (;
Just to say that with a bit of patience, you can code one yourself without problems, and performance are pretty great (although a native implementation would be better, indeed).
Yes i agree with you, i also written a class for animation, but for Now i can't include in my particles engine to avoid Excessive overload.
www.tntengine.com
@atilim, will we have this feature soon?
https://sites.google.com/site/xraystudiogame
Likes: GregBUG, H4ch1, MikeHart
https://sites.google.com/site/xraystudiogame
I've already added Event.COMPLETE to MovieClip. At least this feature will be available with the next version. hmm.. This totally ruins the internal structure of MC. I may not be add this feature.
I means replace
local mc = MovieClip.new{
{1, 1, frame1},
{2, 2, frame2},
{3, 3, frame3},
{4, 4, frame4},
{5, 5, frame5},
{6, 6, frame6},
}
with
local mc = MovieClip.new()
mc:addFrame(1,1, frame1)
mc:addFrame(2,2, frame2)
......
So we can create the mc in a loop and not have to write much code for each frame.
https://sites.google.com/site/xraystudiogame
https://sites.google.com/site/xraystudiogame