Game Creation with XNA/Basics/Setup

From Wikibooks, open books for an open world
Jump to: navigation, search

Setup[edit]

For this book we will use Visual Studio 2008 and the XNA Framework 3.1. Although there are newer versions available, for many reasons we will stay with this older version.

Preparation[edit]

You should first make sure that you have a newer version of Windows, such as XP, Vista or 7, with the appropriate service packs installed. In general, it is a good idea to use the US version of the operating systems. In addition, since at least DirectX 9 compatibility is needed, you may not be able to use a virtual machine (such as Parallels, VMWare or Virtual Box) for doing XNA programming.

Make sure that no older or newer version of Visual Studio is installed on your computer. Especially with older version there are always issues. It is good advise not to have several versions of Visual Studio running on one computer.

Install Visual C# 2008 Express Edition[edit]

First download the C# 2008 Express Edition from Microsoft. You can also use the Visual Studio Express version. Installation is straightforward, simply follow the wizard. After installation, make sure you run Visual Studio at least once before proceeding to the next step.


Install the DirectX Runtime[edit]

Download and install the 9.0c Redistributable for Software Developers. This step should not be necessary on newer Windows version. First, try to get away without it, if in a later part you get some funny error message related to DirectX, then execute this step.

Install XNA Game Studio 3.1[edit]

After having run Visual Studio at least once, you can proceed with the installation of the XNA Game Studio. First, download XNA Game Studio 3.1. Execute the installer and follow the instructions. When asked, allow communications with XBox and with network games.

XNA

Test your Installation[edit]

To see if our installation was successful, let's create a first project.

  1. start Visual C# 2008 Express Edition
  2. select File->New Project under 'Visual C#->XNA Game Studio 3.1' you should see a 'Platformer Starter Kit (3.1)', click OK to create the project
  3. to compile the code use either 'Ctrl-B', 'F6' or use 'Build Solution' from the Build menu
  4. to run the game use 'Ctrl-F5', enjoy
  5. take a look at the code, among other things, notice that a 'Solution' can have several 'Projects'

Next Steps (optional)[edit]

We will only develop games for the PC, if you want to develop games for the XBox also, you need to become a member of XBox LIVE and purchase a subscription (in case your university has a MSDN-AA subscription, membership is included).

Advice[edit]

You need to be attentive of which XNA version you have to install.

compatible versions:

Visual Studio XNA Game Studio
2005 2.0
2008 3.0, 3.1
2010 4.0

Authors[edit]

Sarah and Rplano