Where xo,yo = original position, xi,yi = intermediate position and xt,yt = target positon.
The result is something like that :
***(i) ** * * * * * * * *(o) * (t)
The solution for the movement is very interesting so I've just 1 or 2 positions to compute, the tweening makes the other calculations for a smooth movement.
I expected to keep the tween simple and just animate the moving sprite.
I've tried to define mySprite as a movieClip (or 2 in this case) with frame animation :
I use Gtween and TNT Animator with Gideros to do this.
Here's my class that I used to do animation and tweens. (It uses continuous tweens and fires some functions to change animation and key points...) Let me know if any of this sounds like gibberish or there's anything I can do to help.
Comments
It both provides frame animation and tweening capabilities:
http://docs.giderosmobile.com/reference/gideros/MovieClip#MovieClip
mv = MovieClip.new({
{1, 50, mySprite,
{x = {xo, xi, "outBack"}, y = {yo, yi, "outBack"}}},
{50, 80, mySprite,
{x = {xi, xt, "linear"}, y = {yi, yt, "outBounce"}}}
})
Where xo,yo = original position, xi,yi = intermediate position and xt,yt = target positon.
The result is something like that :
***(i)
** *
* *
* *
* *
*(o) * (t)
The solution for the movement is very interesting so I've just 1 or 2 positions to compute, the tweening makes the other calculations for a smooth movement.
I expected to keep the tween simple and just animate the moving sprite.
I've tried to define mySprite as a movieClip (or 2 in this case) with frame animation :
mySprite = MovieClip.new{
{1, 5, jump[1]},
{6, 10, jump[2]},
...
{71, 75, jump[15]},
{76, 80, jump[16]}
}
but it seems not to work.
Do I have to cut the whole movement and change the bitmap at each keyframe (~20) ?
That's no more so easy to compute.
Thank's for your answer.
http://giderosmobile.com/tools/gtween
Dislikes: anneMurielle
You mean GTween can tween a movieclip ! Cool !
I'll try it this weekend.
I use Gtween and TNT Animator with Gideros to do this.
Here's my class that I used to do animation and tweens. (It uses continuous tweens and fires some functions to change animation and key points...) Let me know if any of this sounds like gibberish or there's anything I can do to help.
http://www.tntparticlesengine.com
Not enough tested in my first solution.
@Tom
I'll try your solution, which seems better for more complex animations. >- :-?