Thanks to the community I have finally solved (and understood) my previous memory leak problems.
I have another question: I have a series of game objects that get spawned in the scene and upon collision this objects needs to send a message to the main game loop that will handle a complex logic.
I though about a custom event on the the game objects that triggers a listener in my main game loop but apparently I need to add the listener to my objects and cannot add it somewhere else.
Any idea?
Comments
-What about some global boolean variables or not boolean any kind of global variable, in collusion of objects you will change these global values and in your main game loop you will check these global variables and with simple if clauses you will change the logic of the game.
Of course from your post i can not understand what you want to do actually so i am handling the problem as simple as it can be:) (Simplicity is the best solution always, of course if it is a solution)
But is game object a child of game loop? You can retrieve game objects parent if that helps, using getParent() method and then set its boolean property.
But its really hard to tell without knowing the structure and hierarchy of your project
http://www.nightspade.com