Tuesday, January 23, 2007

State Switching Implemented

So, I spaced out in some class today to think about the State Switching implementation, and ran home to code it.

It's simple. Essentially there's a GameState Interface, which all States conform to. This interface contains methods like Draw, Update, OnReset, etc. Then we have a GameStateManager, which implements the GameState interface, and also contains a method for switching the current state. So when we want to switch from BATTLE mode to MENU mode, it's a simple method call, and the GameStateManager automatically forwards the calls appropriately.

It's all committed to SVN, so Ada, you can maybe help out Baker with the XNA port for now.

-p3000

No comments: