Jump to content

Stop Chained Tweens


luschn
 Share

Recommended Posts

I got a tiny problem with chained tweens, i hope anybody can help me:

var tween = game.add.tween(mySprite).to({someoptions}, 1000, Phaser.Easing.Linear.None)    .to({someoptions}, 1000, Phaser.Easing.Linear.None)    .to({someoptions}, 1000, Phaser.Easing.Linear.None)    .start();

Now what i want to do is to completely stop the whole chain while it runs, and restart it from the beginning. I did this with the following code:

game.tweens.removeAll();

(game is the Phaser instance, of course)

 

The tween gets stopped indeed and the sprite does not move anymore - but when i create a new tween chain right after "removeAll" it does not start immediately. Instead, the sprite stands still for a while (as if the other tween chain would still run in the background but with no visible effect) and the new tween chain runs smoothly after that time.

 

I hope my explanation was understandable :)

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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