Want to make a game? Well then this software is for you. XNA is a Video game development tool that you can program in. The language you need to use is C# and in the XNA section you can learn a lot about programming in XNA or actually, you will learn a lot about programming in general. What you need is to install two softwares:
1. Microsoft Visual C# – 2008 or newer (to follow our tutorials and articles)
2. XNA Game studio – 3.1 for 2008 version and 4.0 for 2010 version
Just follow the instructions when installing both programs/softwares.
When everything is complete, open up C#.

Press Create Project.
Choose XNA Game Studio 3.1 or the version you want to use and then make sure it’s a Windows Game. If you want, you can change the project name to.
Go ahed and press OK.

Now we have all this code .
There are a couple of things i’d like to explain. Alot of codes like Using System; need to be there, so don’t delete them. The green rows that starts out with // means that they are comments, these rows you can delete, (after reading them and understanding them of course).
Now some methods
public class Game1 : Microsoft.Xna.Framework.Game
Here in the main class you declare you variables, like if you want to load a texture it needs to have a variable, so you can call it whatever you want, but before the variable you need to tell the variable what it will be used for. Ex:
Texture2D myvariable;
protected override void Initialize()
This method runs one time when first starting the game. Let’s say you want a wall with a position that never is going to change. Here in this method you can set up the wall so it wont update the positions of the wall, since walls doesn’t move, not in earth anyway.
protected override void LoadContent()
Then we have the Load method. A very important method that loads your textures/sprites/images/sounds. etc. so you can use them in the Draw() method (that we will talk about in a minute. Lets say you want to load a texture from the content, you do that by writing:
myvariabe = Content.Load
where variable is the variable you have declared in your class.
protected override void UnloadContent()
Obvious right? Removes or unloads, lets say, a texture you don’t need anymore. This method is rarely used, especially for beginners.
You unload something by writeing:
variable.dispose();
again where variable is you variable name (could be myvariable)
protected override void Update(GameTime gameTime)
At last! The Update method. Here you update everything like positions, rotations the list goes on. I can’t give a good example on this, the best way to understand is watching the tutorials.
protected override void Draw(GameTime gameTime)
last but not least, we have the Draw method. I think this one also is a little obvious but anyway, the method draws your textures. Ex: if the position is changed in the update method, it will say to the draw method: “hey draw this texture in another position”.
It’s very important to know how all these methods is connected to each other, and the best way to understand it is to try it out. You wont get it the first times, but hey… thats the point of learning.
Remember since it’s from Microsoft, this ONLY works for Windows. If you have any other questions, please ask. Hopefully I can answer them.
I forgot… You can also make games for X-BOX!
Don't miss more tutorials and guides, published daily - subscribe to DTuts by RSS. Also you could Follow us on Twitter or simply recommend us to friends and colleagues!









