C# XNA Game state options and oppions

Started by
1 comment, last by Jouei 15 years, 3 months ago
Ok so i recently ventured into the world of C# and XNA witch i must say i am fairly impressed with and enjoying however i have come up with this one question. In C++ makeing a game state engine is fairly easy but alas i am unsure of how to proceded with C# and XNA i know that XNA has a compent system witch has caught my attention and an interface system but the information i have been reading on it comes to differ and seem confusing at times. This is the basicas of what id like to beable to do with the state engine. Run Main Menu Change to the option selected Eg Options or new game or load game as the case my be I would like to keep these things seperate from each other in there own class and call on them only when needed. Basicaly i want to have one call from my main game code and that inturn iteself calls the correct function from the correct class. now in cpp i could do this simply by useing polymorphism and a pointer. Given that i am so new to C# sharps XNA it seems to me it is posible i am just uncertain of how to proceed. So if anyone knows a way to do this or has an oppion about this please feel free to share it. Fyi the reason for doing it this way is in part micro optimisation and it makes he main game class abit cleaner. ps sorry for the spellingmistakes i typed this in the dark. Regards Jouei
Advertisement
You might want to take look at this sample in xna creators: Game State Manager
I've been using this as my game state manager in my own projects and I've never had any problems with it.
Thanks for the reply iv taken a look at it, it seems to work rather nicly.
Although it will take me alittle while to figure out how it works it shouldnt be to hard :)

Thanks for the great tidbit and have a good day.

Regards Jouei

This topic is closed to new replies.

Advertisement