Search the Community
Showing results for tags 'tweenmanager'.
-
I'm making a game where a function creates a group of "fish" with tweening, and the tween calls another function on completion to create a new tween with new parameters, and so on. When the player's character collides with the fish, I want them to reset, and swim using a new tween. All the code works except that the tween that was in action prior to collision isn't destroyed by .reset function, and most likely is the reason why the fish are jumping around the screen. Here it is: http://chetansharma.info/work/thefishking/v02/ How do I address or stop a tween when I can reference the object it was applied to? I tried creating a tween manager and added all tweens to it (inside a state's declaration) but keep getting errors (in game.js state file) An example on how to solve this would be nice.
- 1 reply
-
- tween
- tweenmanager
- (and 5 more)
-
I'm making a game where a function creates a group of "fish" with tweening, and the tween calls another function on completion to create a new tween with new parameters. When the player's character collides with the fish, I want them to reset, and swim using a new tween. All the code works except that the tween that was in action prior to collision isn't destroyed by reset function, and makes the fish jump around the screen. How do I address or stop a tween when I can reference the object it was applied to? I tried creating a tween manager and added all tweens to it (inside a state's declaration) but keep getting errors.
-
- tween
- tweenManager
- (and 4 more)
-
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
- 3 replies
-
- tweenmanager
- chain
-
(and 1 more)
Tagged with: