Template: Game State Management

February 11th, 2008 by nazeeh Leave a reply »

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!
Share and Enjoy:
  • Print
  • Digg
  • Twitter
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
Advertisement

11 comments

  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. 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. 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.

  7. Jono says:

    Hey Nazeeh,

    You’re tutorials are awesome! It’s really hard to find beginner game tutorials on the web and your’s are clear and to the point. Love it, thanks!

    I was trying to use your template here to make a zune game with xna 3.0 but unfortunately ran into some problems. I get this message when trying to load the template

    “this template attempted to load an untrusted compontent ‘Microsoft.XNA.GameStudio, Version=2.0.0.0, Current neutral, PublicKeyToken…… bla bla bla

    Is the problem simply that the template was made to work with version 2 and Zune development is in version 3? Can I simply change the value of version to 3.0.0.0? Where is this line?

    Thanks!

  8. nazeeh says:

    Easy :) I should probably provide an updated version :/

    Anyway… load up the project in Visual Studio, remove all the references to XNA framework stuff (in the solution tree->References) and re-add them again to have the new ones. This should do it :)

    and thank you for your feedback!!

  9. Tom Miller says:

    Thanks for the template! I was thinking I was going to run into problems but it works like a dream.

    Geln I liked your coding for fun article.

Leave a Reply