XNA 4 Game Engine Tutor

Asteroids in 3D

End Of Part One Game Screen Shot


Bio:
I’m Lance Zimmerman, currently employed by VMC. There I test video games on the Xbox 360 console for Microsoft. I would like to share a little history about myself. My first computer was a Commodore 64. Later I moved onto the Amiga 500, now that was one mean machine for 1985. One of the first things I did when I got my C-64 was to make a program for it. I taught myself how to program, there was not many books or magazines on that in 1982. I've been playing video games sense 1978, and I still enjoy the classic arcade games. In 2003 I went to the Art Institute of Seattle to learn animation, art, and design. I was not bad at making 3D models, but my texture skills needed allot of work. It was not until 2007 that I really got time to study video game design, and I learned how to really use object oriented programing to my benefit. Sense I've released my first real video game Base Defender back in 2010, a purely 2D game using only sprites, I've sense been learning more about working with 3D graphics, with my friend Scott Jensen’s help I was able to create my own engine that I called Panther3D (I had a personal computer company called Panther PC in the 90s.). I used what I learned making that engine to create this tutor. This may be just a hobby for me, but I enjoy learning as well as teaching others.

About the tutor

    In learning XNA 3, then 4 myself, as I searched the interwebs, and read many books and I noticed there were no really good tutorials out there to really get you started with an engine. There is an old saying, you can give a man a fish, feed him for a day, or teach him to fish and feed him for a lifetime I mention this, because every book I've read, and tutor I've seen does just that, gives you a fish. I intend to teach you how to fish. As a hobbyist programmer myself, I write this for other hobbyist programmers looking to get some game creation going on. We are going to create a clone of the old classic arcade game, Asteroids by Atari in 1979, only we use 3D models for our graphics. Using the engine we create together with the 3D models and sounds I supply, it should only take a few hours a day to complete this tutor. Then it would only take hours to make a simple game of your own using this engine.
 I assume you have a basic or general working knowledge of C#, Java, or C++ at least. What I mean by that is that you know what polymorphic methods are, and other OOP practices so I don't talk over your head. This is meant as an introduction to XNA 4 and real game programming using a game engine, not for learning general programming.
I start with a tutorial on how to make a simple 3D game engine, then proceed to use that engine to make the classic game of Asteroids. I only made one change to the original  and that is when the player is hit, there ship does not explode, instead I take down their hits available points, the player starts with three. That was the one thing that frustrated me, starting after getting hit, and bam a rock hits the player ship again! As would often happen it would put the ship out, right in front of a rock. It would only do a check to make sure a rock was not at the spot.

I have figured out how it would be more efficient by 10%, and more modular. I have removed the use of static class instances in the Game class, and now the classes are referenced to the other classes that use them. I'm also using the LoadContent method to make it more modular. You will notice version two or three of the project files have all been uploaded as of 11/07/12.
Made one small change, moved the scale matrix calculation from the Update method and into a property. Updated 11/08/12.
One last update, to make it easy to copy and paste the Engine folder to a new project, I rename the namespace from Asteroids.Engine to just Engine. I did not think about that until I did it myself. 11/12/12
Made a small change, got rid of redundant code left over from last version that I spotted in a few of the classes. 11/14/12
By the end of the first part of this tutor, the game will look like it does in the screenshot to the left, with scoring, and sounds. In the second part I start by adding particles and effects, and go from there with more features.
To get started, click here for Chapter One.