My First (XNA) Game

 

This tutorial is dedicated to those who are new to the world of XNA. After installing Visual Studio 2008 (or C# Express 2008), DirectX 9.0c, and Game Studio 3.0 (currently CTP), open up Visual Studio. If this is your first time opening the software up, it will probably ask you what kind of settings to use. I recommend C# settings, but don’t worry because the layout is completely changeable. Once the IDE (Integrated Development Environment) is opened fully, we can create our first game!

The first thing to do is to create a new solution. Do this by clicking Create Project or selecting File - New - Project. In the full version of Visual Studio, you can create a blank solution by selecting the Other Project Types - Visual Studio Solutions tree items. This is helpful when you are setting up an environment for a full game. For now, we can stick with the XNA 3.0 template projects.

My First Game - Creating the Project

This creates the basic game project for you and just like any other .NET project, XNA projects use assemblies to actually produce the game. Take a look in the Solution Explorer to the right (to open it, select View - Solution Explorer) and open up the References node. Two noteworthy references are Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game. These two house the functionality of the XNA Framework and produce the game window for you.

The next step, is to create a copy project for the Zune so that your game can run on both platforms. Generally this is done at the, or near the end of your game’s development cycle, but for a simple project like this, we can do it up front. To create a copy project, right click the project node and select Create Copy of Project for Zune. This will generate a copy of the .csproj for the Windows game and use the same files.

Creating A Copy Of A Project

The last step is to build and run these! To test the Windows game out, just go ahead and hit F5 or select Debug - Start Without Debugging. To test the Zune game out, you can right click the Zune project node in the Solution Explorer and select Deploy which simply moves the game to the Zune, or select Debug - Start New Instance. The Windows game and Zune game will both be a blank screen, as expected and seen below.

The End Result

Tags: , ,

3 Responses to “My First (XNA) Game”

  1. Focused Games » Blog Archive Says:

    [...]   « My First (XNA) Game [...]

  2. Kigunda Says:

    Logic told me “My First XNA Game” was an actual, and to an acceptable extent, complete XNA game. Logic is such a liar

  3. radray Says:

    awsome keep them comin i love this zune you rock.

Leave a Reply

You must be logged in to post a comment.