Jump to content

Looped tween doesn't start again when return to browser


BobDylan
 Share

Recommended Posts

When I create a repeating tween that yoyos with :

var tween = game.add.tween(sprite).to({y: sprite.y+100}, 1000, Phaser.Easing.Linear.None, true, 0, 9999, true);

it restarts beautifully when I leave the browser and return.

But when I create a chained tween that loops, like :

var tween = game.add.tween(sprite).to({y: sprite.y+100}, 1000, Phaser.Easing.Linear.None, true, 0, 0, false);tween.to({y: sprite.y}, move.time, Phaser.Easing.Linear.None, true, 0, 0, false);tween.loop();

then the tween is stopped and doesn't always restart when I return to the browser (but sometimes it does, after a while!).

 

Is there a reason for this, or is this a bug?  Any way to make this work?

 

 

UPDATE

 

It seems the autostart of the second chained tween causes this behaviour. When I only set autostart on the first tween, the tween is being restarted when I return to the browser.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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