Skip to content

Tween._inited does not reset if scene is being destroyed or removed inside the game and rebuild #92

Description

@simongcc

I have written a game using easeljs + preloadjs + soundjs + tweenjs.
The scene order like this:
I used the same canvas for different scene. Promo Scene -> Start Game Scene
Every time finishing the game, the restart button will go to Promo Scene again.

I found that probably(I haven't dig deep enough to find out) I use stage.clear(), stage.removeAllEventListeners() and so on.
The Tween ticker is somehow being removed from the scene.
So, first run, everything is fine, afterward, the Tween does not run unless I set Tween._inited = false before anything start again. Since the big Tween is supposed to be added once as tick function according to the source code logic.

I add this in restart game logic createjs.Tween._inited = false; as workaround.
Since _inited is undocumented due to it is an internal property.

I think it is an issue for restarting everything, in the above situation, but not necessarily a bug.

if (!Tween._inited && createjs.Ticker) {
	console.log("init Tween");
	createjs.Ticker.addEventListener("tick", Tween); Tween._inited = true; 
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions