Wednesday, January 12, 2011

XNA Basics - Part 2

Last post we just touched XNA game studio virtually and felt what it is like. Now we'll get more serious step by step.

Now let's dive up a bit in the Game1.cs. Don't worry you will not have to talk about "Program.cs" much. 
Game1.cs has some very important methods. These are some methods that needs to be overridden, since Game1 inherits from the "Game" in the XNA framework.
1. Initialization()
This is where you initialize your variables. Simple isn't it?

2. LoadContent()
Now this is the place you put your codes, which will load what needed before the game        starts.

3. UnloadContent()
Not that important at this stage.

4. Draw()
What needs to be drawn in the window when the game is compiled. Rectangles, squares, fancy cars, crazy pigeon whatever.... 

5. Update()  
Without this, you will have a perfect background image and some fancy objects in it, but you can't do a thing, I don't suppose you want  that. This method will do whatever inside it 60 times a second and call the Draw() method also. This value isn't fixed.

2 comments:

  1. Interesting. Why didn't you continue this series?

    ReplyDelete
  2. Hehe, I forgot all about it. What else will be a better time to continue this than this, right? :)

    ReplyDelete