Repainting From Another Class
Since I have been having problems with multiple panels in my JFrame, I decided to put all of the paint components for my graphics into one panel.
My current structure is:
Game (sets up, runs timer to run update movements)
MyLevel(Adds panel to frame with the level, keyboard listener to track player movements)
MakeLevel(Puts each level component into one paint function)
Player(Has players functions to update X and Y, jump, etc.)
The problem now is that although it is much easier to organize and draw each part of the game, I have lost the ability to use repaint in the Player class (Player paint function used to reside in Player).
I was considering using a Player function to return the players x and y coordinates to MakeLevel, then repainting the specific location of the player. However, I can't seem to make it work properly. Any ideas? Thanks for any help!