Programming with XNA Game Studio

Getting Started

Learn how to download, install, and test Microsoft's XNA Game Studio 3.1

Published: January 12, 2010
Validated with Amaya

by Richard G. Baldwin

XNA Programming Notes # 0100




XNA Game Studio 3.1
Note that all references to XNA in this lesson are references to version 3.1 or later.

This is the first lesson in a continuing series dedicated to programming with the XNA Game Studio. I am writing this series of lessons primarily for the benefit of students enrolled in an introductory XNA game programming course that I teach. However, everyone is welcome to study and benefit from the lessons.

Viewing tip

I recommend that you open another copy of this document in a separate browser window and use the following links to easily find and view the figures while you are reading about them.


Supplemental material

I recommend that you also study the other lessons in my extensive collection of online programming tutorials.  You will find a consolidated index at

Background information

According to Microsoft, "Microsoft XNA Game Studio 3.1 makes it easier than ever to create great video games for Windows-based PCs, Xbox 360 consoles (with an active premium XNA Creators Club subscription), and Zune digital media players."

Download and installation instructions

As of the date of this writing in December 2009, Microsoft XNA Game Studio 3.1 is freely available for downloading here. Installation instructions are available here.

In order to program with XNA, you must also have Visual C# 2008 Express Edition or Microsoft Visual Studio 2008 Standard Edition installed. Visual C# 2008 Express Edition is freely available for downloading here.

Test your installation

Once you have the software installed, start Visual C# from the Windows Start menu. Pull down the File menu and select New Project. A dialog box will appear. Select "XNA Game Studio 3.1" on the left side of the dialog and select "Windows Game (3.1)" on the right side of the dialog."

Name your project First Project, specify a location for your new project and click the OK button. An IDE should appear looking something like Figure 1.

Figure 1 XNA 3.1 IDE.

Skeleton code

Skeleton code for a Windows game project will have been created in the editor portion of the IDE. I will explain this code in detail in a future lesson.

Run your program

Run your program by selecting Start Debugging on the Debug menu. If everything is working properly, the game window shown in reduced form in Figure 2 should appear on your computer screen.

Figure 2 XNA game window.
XNA game window

Run your program outside the IDE

Once you have run your program successfully from inside the IDE, your project file structure should look similar to Figure 3.

Figure3 Project file structure.
Project file structure

At that point, you should be able to double click the exe file highlighted in Figure 3 and cause your program to run.

Congratulations. You're now ready to start learning how to program using XNA.


Copyright 2009, Richard G. Baldwin.  Reproduction in whole or in part in any form or medium without express written permission from Richard Baldwin is prohibited.

About the author

Richard Baldwin is a college professor (at Austin Community College in Austin, TX) and private consultant whose primary focus is object-oriented programming using Java and other OOP languages.

Richard has participated in numerous consulting projects and he frequently provides onsite training at the high-tech companies located in and around Austin, Texas. He is the author of Baldwin's Programming Tutorials, which have gained a worldwide following among experienced and aspiring programmers.

In addition to his programming expertise, Richard has many years of practical experience in Digital Signal Processing (DSP). His first job after he earned his Bachelor's degree was doing DSP in the Seismic Research Department of Texas Instruments. (TI is still a world leader in DSP.) In the following years, he applied his programming and DSP expertise to other interesting areas including sonar and underwater acoustics.

Richard holds an MSEE degree from Southern Methodist University and has many years of experience in the application of computer technology to real-world problems.