The Concept

I had looked at XNA in the past, but quickly lost interest. Once XNA 3.0 was released, I was interested in some of the new features and had a hobby project I was working on which I thought would be a good opportunity. I did a quick 3D tutorial (thanks to the XNA Creators Club) and was impressed with how fast I was able to get something that looked pretty good and, more importantly, could have some reuse. The tutorial was basically "Missile Command" - a fixed cannon you could rotate on 2 axes (left/right and up/down) to shoot at UFO's which were flying overhead. One of my favorite games as a kid was "Galaga" and I figured if I moved the camera to above the scene instead of behind the cannon and turned the cannon into a ship that you could move left and right I would be pretty close pretty fast.

The Models

Once I decided to try and tackle a Galaga clone, I set out on creating the models. I had already been playing with Blender for a while so it was pretty basic. I found some screen shots from the original game and set one as the background and used it as a reference to create my models. The current version of Blender includes a plug-in to export to FBX so I was able to export the models and import them into the pipeline.

Early Design Elements

A problem I always had with many of the past XNA tutorials was that they were not well-designed. Most were not object-oriented at all and simply packed all objects and logic into the game class. The tutorial I used as the basis for my game wasn't much different, but it did have some reusable methods and classes. This helped me create some quick-win "components". I use the term "component" loosely because, out of pure laziness, I didn't implement the XNA component model in these first classes. I created a "ModelObject" class that would render a model at a given 3D position and scale. I also created a "Camera" class which contains (and calculates) the view and projection matrices and an "AudioController" class which can be used to play sound cues. These classes were all implemented in the tutorial as a learning experience, but then made the Galaga project development a little easier.

XNA Component Model

After I was able to get most of the game working, I decided to tackle converting everything to the XNA component model. This helped clean up a lot of the sloppy code that resulted from "rapid prototyping" (AKA laziness). The last few major bugs really got me motivated to do more cleanup so I made some fundamental changes to the design like creating a "Player" class (which will come in handy for multi-player modes) instead of just having the PlayerShip class and all kinds of crazy logic in the game class to deal with multiple ships.

Last edited Mar 29, 2009 at 5:16 PM by douglampe, version 4


No comments yet.