Template: Game State Management

In my last post in this series, I talked about the GameStateManagement sample. I got a few comments asking that I upgrade it to include the newly threaded Loading.cs that was introduced in the Networking version of the same sample. So, I did that and bundled the whole thing in a template so you can always have it to start new projects with.

The new version of the Game State Management sample now includes a threaded Loading screen that allows you to animate something on the loading portion while your content is loading. I also followed Stephen’s blog post about creating a project template for XNA GS 2.0 to convert it into a usable template (very good read by the way!).

Here’s the template for your downloading pleasure: GameStateManagementWindows.zip

To install it, you need to place it in your ProjectTemplates folder. To find out where that folder is, ask Visual Studio:

  • Click on Tools -> Options
  • Click on Projects and Solutions->General from the tree
  • See where it is? It’s the “project templates location” (second textbox):

image

  • Copy that path and open it in Explorer or whatever.
  • Create a folder under “Visual C#” called “XNA Game Studio 2.0″ and place the zip file you downloaded there:

image

  • That’s it! Now whenever you create a new project, you’ll have this template to start with:

image

Enjoy! Now I’ll start working on my next post ;)

Thanks for reading! I'd love to hear your thoughts, feel free to leave a comment below. Don't forget to subscribe to my RSS Feed!

8 Responses to “Template: Game State Management”

  1. Jim Welch Says:

    Was editing the LoadingScreen.cs file the only changes you made to the template? I saw the new threading code there, but I wanted to make sure I didn’t miss anything else. Thanks.

  2. nazeeh Says:

    Yep… the only difference in this template from the sample you download from the creators site is that I took the Loading.cs from the NetworkGameStateSample and put it in the old one. I edited it slightly to remove network specific parts it had, but other than that, nothing else changed.

  3. Stephen Styrchak Says:

    Heh! I take it you wouldn’t mind if I posted a follow-up on how to make a .vsi to automatically install your custom templates… I’ll put that on my to-do list! ;-)

  4. nazeeh Says:

    Yeah man! That would be awesome :)

  5. Glenn Wilson Says:

    I put together an article for Coding4Fun a long while ago (Managed DirectX Days), and have updated an Version to XNA 1.0r.

    http://www.virtualrealm.com.au/blogs/mykre/archive/2006/12/23/tutorial-02-turning-your-xna-app-into-a-starter-kit.aspx

    The above post should give you the steps to create a VSI File for your templates.

  6. A Game State Manager Menu Designer! | Developer Home Says:

    […] Styrchak (BadCorporateLogo) wasn’t content to enjoy Nazeeh’s cool Game State Management template.  Nope, he had to show off his Visual Studio wizardry at extending Nazeeh’s work.  […]

  7. vanjab Says:

    This is incredibly useful, thank you.
    It’s just what I needed to convert my mini games into something “complete”.

    The only problem I have had is in the implementation of HandleInput. In my game, the input can not be processed with out access to the GameTime, so I added this in to the function. I think this might be a good addition to your library.

  8. Vanja’s Lolz » Blog Archive » Pong update Says:

    […] into the world of XNA3D (failed, need to find a 3d modelling package…) when I stumbled upon a game menu framework for xna and its absolutely fantastic! The menus I have in the updated game all come with the standard […]

Leave a Reply

The page's WebCounter count says that you are visitor number Visitor Counter by Digits
FireStats icon Powered by FireStats