XNA how to organize code with game components (managers)

Posted by Johannes on Stack Overflow See other posts from Stack Overflow or by Johannes
Published on 2011-01-14T01:42:08Z Indexed on 2011/01/14 3:53 UTC
Read the original article Hit count: 196

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about class

Related posts about game-development