Game State Manager + Menu


For the final project it was deiced by the group that I would make the game state manager and things such as the menu which come with making it.

 The way I have done my state manager is several different enums , each representing a different state of the game , for example there is the Main Menu state, Options state and Exit state.


The main render within the game checks the state to see what it currently is set to, from getting that information it then take the information from things such as the renderer for that state, as I have setup the code so each state has its own renderer linked to this, I decided on doing this as I believe it makes the code a lot easier to read and easy to find the code as its not in 1 massive function, As well as pointless rendering does not happen when rendering through this state method.

 

The menu system is very similar to the previous project(Ex Machina) in that the buttons work the same, i use a initialise sprites function to hold a lot of information for the sprites to make rendering easier and the is inside function which checks to see if the mouse is inside the buttons bounding box ,  some slight changes to the code to make it better, the changes that have been are things such as it is separated more and also bugs such as scene skipping that were all within the previous project have been fixed and are no longer an issue.


The biggest addition to this menu system is that a rules session has been added, which gives you a detailed multiple page description on how the game rules work and what the basics of the game are.



Leave a comment

Log in with itch.io to leave a comment.