Last Modified 5-1-2010

IUSB

XNA Game Studio Introduction

This development guide assumes you have Microsoft Visual Studio or Microsoft C# Express installed on your computer. We would recommend that you have Vista or Windows 7 installed as your OS. You will also need an XBox and XBox Live Membership to download your games, although you can develop the games in PC mode and download them at a later date also.

You can download C# from Microsoft to begin software development. After your C# software development environment is installed, you will also need to download the XNA development add-on from microsoft as well. The packages self-install so there is no need for redundant explanation. The rest of this guide begins after the proper software development tools have been added to your system.

Additionally, this guide assumes you are familiar with C# coding techniques the .NET Framework. If you need to brush up on your C#, or just need a 'Quick Reference', you may want to spend a couple of minutes in the C# Reference Guide to get up to speed.

Starting the Game Development Studio

Select Start → All Programs from your Windows main screen as indicated in the diagram below:

Start All Programs

Figure Intro-1: Start → All Programs



All Programs will display a list of Program folders. Select the program that was selected by the XNA Game Installation package when you installed the game software. (It will be either Visual Studio or C# Express) as indicated in the diagram below:

VS2008

Figure Intro-2: Visual Studio or C# Express



From the Microsoft Visual Studio Start Page, select File → New Project as indicated in the diagram below:

File → New Project

Figure Intro-3: Visual Studio File → New Project



If C# is not your preferred language in Visual Studio, you must indicate that you wish to develop a project in C# rather than Visual Basic or Vixual C++. C# is found under Other Languages in the Project Dialog Window as indicated in the diagram below:

Other Languages

Figure Intro-4: Microsoft Visual Studio Other Languages



Double-Clicking on other Languages will bring up Microsoft Visual C#/C++ in Visual Studio. Select the Visual C# templates menu by double-clicking on the Microsoft Visual C# option as indicated in the diagram below:

Visual C#

Figure Intro-5: Microsoft Visual C# Template Selector



  1. Select XNA Game 3.1: We will work with the "latest and greatest" for now.
  2. Select Windows Game 3.1: When the game gets interesting enough, we'll make an Xbox version.
  3. Press OK: You may change the name and location fields, but right now, I don't think it matters.

The above selections are illustrated in the diagram below:

Create Project

Figure Intro-6: Create Windows Game Project


In order to continue with this guide, and complete the discussion of Starting a Game Project and the corresponding C# code:

Press the Button below:





Home


XNA Game Studio

Starting Game Studio


Starting Game Studio Part II

Set Breakpoint


XNA Game Foundation

Initialize Game

Graphics Device Manager

Graphics Device Variable

Drawing And Updating

Draw Method

Sprite Batch Object

Sprite Batch Draw


Content Manager

Load Content Method

Initialize Method

DrawString( ) Method

Update( ) Method

Unload Content( )

Vector2 Properties


XNA 2D Games

2D Coordinate System

2D Image Files

Content Pipeline

Image Loading & Storing

Texture Objects

Rectangle Class

Adding Content


Adding Content Part II


Animated Sprites

Enabling Transparency

Draw & Animate Sprites

Set SpriteBatch Draw

Set Texture2D

Update Sprite Position

Update Sprite Rotation

Resizing the Sprite

Set Layer Depth

Title Safe Region


User Input Devices

Keyboard Input

GamePad Input

Rocket Game 1

Game Class Variables

Texture2D.GetData

Texture To 2D Array


LoadContent( ) Game Code

Create Translation Matrix

Object Collision Function

Update Keyboard Input


SpriteBatch Draw Rocket

SpriteBatch Draw Target

Game1 Draw Method


Adding Text to Game Screen


Game Screen with Text

Add Animation to Sprites

GameTime Class


Screen Height & Width

Update Sprite Position

Animate Complete Listing


Can't open VisitorHistory.txt for reading