XNA UK User Group

A helping hand for bedroom coders throughout the land.
in

This Blog

Syndication

Twitters

RandomChaos

RandomChaos Game State Manager Source Release

So, as I said in my last post, I have decided to put up the source code for the GSM. To use it in your projects, either add the project to your solution and add the reference from the project tab of the Add Reference window or, build it and brows for it when adding it as a reference. Then you need to make sure the built content folders and there contents are in the build folder of your project or you will get build errors.

I am also including a game written using the GSM to show how you can simply inherit from it to build a quick and easy menu system for your game. In this case I chose something I knew would be quick to write as a demo, Space Invaders. All assets, both image and sound are courtesy of Classic Arcade Games.

All in all it took me about 3 days to code the game with the GSM, so that's about a hour and a half a night,hmm, maybe 2, so say 6 hours to do this. Now the assets are pre built so did not have to do those, well broke them up a little and formatted them, but not much really. Anyway, I think it shows how fast you can create a simple demo.

  

It's pretty simple stuff, I have not put any nice animation, the bunkers can't be damaged and the invaders are not animated.. I know, half a job... Oh well, you have the GSM source now and my half done Space Invaders....enjoy.

If you have any queries or issues using the GSM, give me a shout, just remember, it comes warts and all...

Download located here.

Comments

 

GameDevKicks.com said:

You've been kicked (a good thing) - Trackback from GameDevKicks.com

April 7, 2008 10:49 PM
 

OmaR_ShaRif said:

Hello,

I think your GSM is very useful, but I have a question.

I have a MainMenu that I display by default, and I put sound in this mainmenu, and I would like to stop the sound when I choose one of the item.

I think I have to play with the AdditionalSelectCode event, but I'm unable to do so, how can I do to stop all the sounds with this event, I don't know much of delegates, I tried something based on a course on the internet, but nothing goes well.

I really enjoy if you can put an example of how to do this.

Thanks

April 13, 2008 1:33 PM
 

Nemo Krad said:

OK,

AdditionalSelectCode is an event like any other, just wire it up like you would any other event. If you have not wired events before let me know and I will put up and example.

Once you have wired the event up you can get the MenuItems ParentMenu object and use it's StopMusic method to stop the sound.

Glad you like my GSM and find it useful.

Let me know if you want the event tutorial..

April 13, 2008 8:14 PM
 

JSouth said:

Hey, I am just getting into XNA game development and was working on my own screen system similar to this. I am going to check out yours, it sounds like it does exactly what I was looking for. I would love to see the tutorial for events that you mentioned when you have time to put it together.

April 17, 2008 4:31 PM
 

H said:

hiya,

i'm new to xna and i have just developed a game which has a menu screen but i can work out how to get from the menu screen to the actual game. can you please help

April 18, 2008 4:43 AM
 

Nemo Krad said:

J South,

As soon as I get the time I will put up an event sample.

H,

I guess the best advice I can give you is download the source from here and see how I am doing it through my GSM. I do not know the mechanics of your system so will find it hard to comment.

April 18, 2008 9:01 AM
 

OmaR_ShaRif said:

Sorry I'm late.

Finally, I made a new game "from scratch", without using your GSM.

I had some issues with the fact that all the menus are all launched at the same time, and that they all stay "alive".

Thought your GSM is very interesting, I don't have much time to learn more about the using.

Thanks

(sorry for my poor english :P)

April 22, 2008 6:43 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About Nemo Krad

Have been a professional developer since 1995. My skill set ranges from C/C++, VB6,MSSQL, Java Script, VB Script, HTML/ASP, Java, C#, ASP.NET as well as others. I started 3D and games development when the first release of XNA came out in December 2006 and have become addicted to it.