XNA how to organize code with game components (managers)
- by Johannes
XNA
If I have a button class, and I have a buttonManager class that manages what buttons to be drawn to the screen depending on what the current game state is (main menu, in game, etc), how do I organize my code so that when I click on a button, it takes the user to a different screen. (ex. options menu, ingame).
To be more specific, if I were to put the check to see if the user clicks on the button within the buttonManager how would I have the game switch and run the actual game (which is in an entire different class)?
Main gameclass
buttonManager game component (adds buttons)
Button class