Search the Community
Showing results for tags 'isrunning'.
-
Hi, I want to check whether a sequence of tweens has completed. However, the 'isRunning' flag only indicates whether the first step is 'running'. During step 2-4 in the example below it's set to false. It will be set to true again on the first step if the sequence loops. Is this how it's supposed to work? Is there a simple way to check whether the entire (non-looping) sequence has completed? var game = new Phaser.Game(640, 480, Phaser.CANVAS, '');var tween;var thing;var main_state = { create: function() { thing = {x: 10, y: 100 }; tween = game.add.tween(thing); tween.to({x: 10, y: 300 }, 1000, Phaser.Easing.Bounce.Out); tween.to({x: 200, y: 300 }, 1000); tween.to({x: 200, y: 100 }, 1000); tween.to({x: 10, y: 100 }, 1000); // tween.loop(); tween.start(); }, render: function() { game.debug.text('tween.isRunning: ' + tween.isRunning, thing.x, thing.y); }};game.state.add('main', main_state);game.state.start('main');
-
Hey all, I'm trying to initiate different sprite tweens at different times on a variety of sprites that are in a group (non-looping tweens). I don't want to tell a already tweening sprite to start() though since it resets it's x and y to the beginning and it looks choppy. I noticed that on the Phaser github, it says this was already fixed: Tween - isRunning not reset when non-looped tween completes, but after downloading the newest code, I still have this issue. I even tried setting isRunning true and managing it myself, but it's still forced to false every-time. My sample code: if(!tentacles[main.octopus.tentaclesAnimNum].tween.isRunning){ tentacles[main.octopus.tentaclesAnimNum].tween.start(); } Any help would be greatly appreciated!