Add a couple private variables to the sprite, let's call them GoalX and GoalY.
+ distance(Sprite.X,Sprite.Y,Sprite.GoalX,Sprite.GoalY) > 1
> Sprite: Set position to lerp(Sprite.X,Goal.X,0.1),lerp(Sprite.Y,Goal.Y,0.1)
++ (subevent) distance(...same as above...)<1
>> Sprite: Set position to Goal.X,Goal.Y
This basically moves the sprite to goal coordinates, with easing toward goal. See lerp expression in the manual and experiment with it. You can also use this for snapping to position or another object. Following, too.
The subevent makes sure the sprite sets proper position whenever it is close enough.
If you want a more smooth move from start to finish, use lerp(StartX,GoalX,Timer),lerp(StartY,GoalY,Timer) as well as a Timer variable which you add dt to (see system expressions, timedelta or deltatime).
+ Sprite.Timer < 1.0
> Sprite: Set position to lerp(StartX,GoalX,Timer),lerp(StartY,GoalY,Timer)
++ Sprite.Timer >= 1.0
>> Sprite: Set position to GoalX,GoalY
So, this basically moves the sprite from Start to Goal in one second (Timer = 0 at start and Timer = 1.0 at finish).
For easing, you want to get a little more creative, you can use the cos for one form of easing at start/end. But that's getting a bit mathy.Mipey2012-09-18 11:27:37