I’ve got a timer class that controls level life in my game. When the timer runs out, I want to send a message back to my document class to remove the current level, clean up the event listeners, and begin again according to what happened in the last level.
How can I access functions like this from outside the main class? If I make it in a static function, I can no longer use removeChild.
Also, can I remove event listeners from out side the class in which they were created? What would be the easiest way to clean up listeners from multiple classes at the end of each level?