The Second Coming

by admin

Last semester I enrolled in a game design class using Microsoft’s XNA framework.

It was a long road, but in roughly three months my partners and I went from absolutely no engine to a complete and playable game which we presented in front of roughly a hundred people.

ScreenShot1

Is it fun?

We hope so! The crowd, Microsoft MVP’s and our professors seemed to enjoy it. Two players move through three levels, taking on various aliens and bosses until they get to the end of the level. The interesting dynamic is that one of the players is strictly “hand-to-hand” except for a “gravity gun” which the player may use to draw enemies towards themselves. This really becomes important when facing the bosses of the levels as one player has to quarantine and control the enemy, while the other shoots it into oblivion. The premise of all this madness is that an alien race seeded the Earth a few million years ago with life. Every so often they come back to “harvest” the organisms that have developed for energy. What do you think happened to the dinosaurs?

Umbarak!

What did you do?

I worked primarily on base engine code. Physics, controls, level construction and cleanup, entity handling, etc. The beauty of my work was that a lot of the difficulties in game design were already taken care of in the XNA and TorqueX frameworks we used. It was just a matter of implementing the respective frameworks on top of each other properly. My favorite part was coding in some basic Newtonian mechanics. OK-More like Aristotle’s mechanics, but still fun. Here’s an excerpt of the code used to imply an impulse to the player when firing a weapon:

Vector2 impulse = new Vector2();
impulse.X = (float)Math.Sin((double)MathHelper.ToRadians(-_player.Rotation + 180.0f)) * -_projectileKickback;
impulse.Y = (float)Math.Cos((double)MathHelper.ToRadians(_player.Rotation - 180.0f)) * -_projectileKickback;
_player.Physics.ApplyImpulse(impulse);

My other team members put a lot of effort into this project. One of them focused
primarily on the user interface, artificial intelligence, and coding the weapons. The other did a fantastic job of creating all the sprites and sounds for our game. His work really added a whole dimension to the project by giving it a polished look and nice animations. Not only that, but his bosses looked menacing!

I also focused on the “Level Editor” which was coded in Delphi 2007. It helped us streamline designing the levels near the finalization process of the game. Not very elegant at all, as it simply generated a text file with entities which the game engine parsed. Also, using the editor, you can only specify rectangular bodies for defining the collision edges of a level.

RepriseLevel Editor

That’s it. If you want more information head over to The Second Coming on GoogleCode. There you can download the source and binaries of the level editor and game itself. There’s lots of work to be done to complete the game and squash some bugs. Overall it turned out to be a success. I hope this will be one article in a series about game development at the student level and the details of The Second Coming. Enjoy.