I am currently working on a simple game, using Slick2D, as a means of practice and I was wondering if someone can give me some advice on how I’ve set up my code. This is how I have it thus far:
AssetLoader - This basically loads the sounds and sprites. It also has a set of getters for these assets.
SoundManager - This basically handles all the sound playing and music playing.
UserInterface - This handles all the userinterface nonsense.
Debug - This is a simple class of booleans with getters & setters that are used to check for when certain debug functions are enabled.
Now, in the GameState class, the SoundManager object is created and is updated in the update method. The SoundManager gets it’s sounds from the AssetManager and handles when a sound is playing. The UserInterface object is also created and has a render and update method. The UserInterface gets all of it’s Images from the AssetManager; it also checks the Debug if any of the options are enabled so it can draw them.
Now I have a debug option for displaying the current track. The UserInterface will check the Debug to see if this is turned on. If it is, it will then check the SoundManager for what song is playing and display it.
So, does this make sense? Am I going about it all wrong? Should I break it down more? Any advice will be appreciated!
Thanks!