Creating an XNA Project


In the previous tutorial, we looked at how to install XNA Game Studio, with Visual C# Express. In this tutorial we will look at how to create a new game project, using a built in template. After running our new game, we will ltake a look at the code that was written for us in the template.

Creating an XNA Project

We will start by creating a new game project from the built in template. To do this, we will first discuss how to open XNA Game Studio, then how to create a new game from the template, and then we will see how to run our game.

Opening XNA Game Studio

To run XNA Game Studio (for versions 2.0 and also 3.0), go to the Start menu and look at 'All Programs'. Look for the 'XNA Game Studio 2.0' group (or 'XNA Game Studio 3.0 (CTP)' group if you installed that version) and click on 'Microsoft Visual C# 2005 Express Edition' (or 'Microsoft Visual C# 2008 Express Edition') to open the program, as shown below:


It might seem wierd that there is no specific 'XNA Game Studio' program, but remember that we installed XNA Game Studio over Visual C# Express, so when we open Visual C# Express, we will have all of the required components. When people refer to XNA Game Studio, they are talking about a version of Visual C# Express Edition (or Visual Studio) that has had the XNA Game Studio stuff added into it.

Using the Template

Now that we've got XNA Game Studio opened, let's create a new project. The XNA people have made this very easy to do. There is a built in template that we will use to get started. When XNA Game Studio opens up, you should be able to see a group box called 'Recent Projects' on the left side that looks like the image below:


Running the Game

A Look at the Generated Code