Zeeshan Ahmad
Zeeshan Ahmad

Reputation: 455

Animate/Tween entity in flashpunk

So I'm new to the FlashPunk library, and don't know how to tween an Entity? So for example how do you animate an entity's x value from the World's class?

Upvotes: 1

Views: 548

Answers (1)

varbrad
varbrad

Reputation: 474

You can use Tweens, such as the VarTween which can modify an object (or Entities) property.

For example, something like this would work;

var tween:VarTween = new VarTween();
tween.tween(MY_ENTITY,"x",500,2);

This would tween MY_ENTITY's x value to 500 pixels in 2 seconds.

Upvotes: 2

Related Questions