I am still learning and I am trying to design the game levels for my first game (a platformer).
I have some straightforward questions because I feel I am on the wrong way.
Should each level have its own class ?
The way I am trying to do this is, when one finishes the first level I set all variables to null that belong to that class, unregister all events and remove all children from the stage, call a second level constructor, without declaring any variable, new level2();
and set a static var to true "in order to save" that progress in case one wants to play that level again.
However I see the code becomes messy, I run into issues, and memory management concerns arise.
I searched for help all over the internet but I can't find any tutorial that explain it in details, so I'm trying out many ways of achieving what I want, but now I am really in need of some advices to not get lost.
No comments:
Post a Comment