Closed netgfx closed 9 years ago
You've missed out the repeat
parameter. It comes before yoyo
(or loop).
The second line of code is basically setting a boolean into what should be an integer.
so it should be to(obj, duration, Phaser.Easing.Linear.None, true, 0, 0, false); So since I had it wrong instead of some error or warning it just kept on doing yoyo, is that intentional?
A repeat value of -1 means "repeat forever". Whatever you'd done, it thought you had passed that. Give it a number and it'll be fine.
@Firanolfind questions like this are best directed to the forum or Discord, especially as this closed issue is 5 years old! You're lucky I even saw your message. In Phaser 3, repeat
is set on a tween property, where-as loop
is for the entire tween. A Tween that was updating say 3 different properties could have a different repeat value per property, but the loop value would loop the entire tween over again, not a specific property. They work together.
While this is correct: var tween = game.add.tween(item).to({width:100}, duration, Phaser.Easing.Linear.None, true, 0, 0);
When writing it like this: var tween = game.add.tween(item).to(obj, duration, Phaser.Easing.Linear.None, true, 0, false);
results in infinite looping.