DaVikingCode / Citrus-Engine

Modern AS3 Game Engine
http://citrusengine.com/
Other
555 stars 231 forks source link

LevelManager / A level gist #233

Open gsynuh opened 10 years ago

gsynuh commented 10 years ago

https://github.com/DaVikingCode/Citrus-Engine-Examples/blob/master/src/box2dstarling/ALevel.as ALevels should removeAll() listeners to their signals on destroy I think, its not made clear in the examples.

This gist https://gist.github.com/alamboley/4024256 Shows how to use the LevelManager and use those signals, yet I can see a potential ref to null error due to signals being dispatched when the actuall level has been destroyed because the listeners are still attached.

alamboley commented 10 years ago

Right, there is an issue since Signals aren't removed. However I'm not sure that the removeAll method should be called in the State's destroy method:

So I think those Signals should be removed before new level / Signal assignement https://gist.github.com/alamboley/4024256#file-gistfile1-as-L13 What do you think ?

gsynuh commented 9 years ago

just a little update to this issue, apparently restartLevel in the box2D-starling example doesn't work