I work with libgdx and I have this situation where I use a Stage with threeActors attached.
When the act() method is being called for the stage, each of the actors' act() method is being called. This is the default behavior and it's correct.
But, if i dispose the scene in the second's actor act() method, then the act() method of the third actor is still being called. I would not have expected this behavior. It's like this actor is not being detached immediately after the dispose() method is called on the stage.
This last call on the third actor is problematic for me because i get an exception and i don't know how to avoid it. If the third actor's act() method would not be called one last time before the scene is actually disposed it would be great.
Do you have any idea how could i avoid this?
I find it difficult to change my game design because in my case the second actor is an enemy and the third actor is a defense tower. When the enemy dies, i dispose the scene in order to show the game over screen. But the tower still acts in the background...
actmethod is called once in a frame, regardless of what other actors are doing. I think in most cases this is the most useful behavior. Maybe you could share what is happening in your tower's act method that causes an exception. - Tenfour04