Jump to content

Tweens one by one


LeeZolait
 Share

Recommended Posts

I haven't tested this as I'm not around a computer to test, but this should work also, it can be cleaner sometimes to look at, than chained tweens.. also works better for dynamically creating tweens. 

tween = game.add.tween(object);
tween.to({x: 1000}, 2000, Phaser.Easing.Linear.None);
tween.to({x: 2000}, 1500, Phaser.Easing.Linear.InOut);
tween.to({x: 3000}, 1750, Phaser.Easing.Quadratic.InOut);
tween.onComplete.add(function() {
    // callback complete anom function
}, this);

tween.start();

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...