Original Post
With any applet I make, I have a GameManager class that performs all the displaying and double buffering. If I create something like a Sprite object for the player I need to ensure that that classes paint method is called by the GameManagers painting method, passing it the buffer and then retieving it.
This means I have to specify from the very start what things are going to need drawing so I can put in the necessary paint calls for each and every object I implement.
Is there a way of getting something to paint itself without having the main class tell it to do so? That way I can create things, like explosions / particles etc, have them paint themselves and let them deal with it. Otherwise I need a mass of paint calls for everything that would ever exist and and then filter out those that aren''t needed at the time.
I hope that makes sense. Any suggestions?