Monday, September 26, 2011

Making a thrust like game for the iPad

I thought I'd post some information on one of the games I made for the iPad. I always loved the original Thrust game http://en.wikipedia.org/wiki/Thrust_(video_game)
So I inspired myself from the gameplay and from there tried to create a game on the iPad.

I developed a really cool level editor in Inkscape which is a free and open source vector drawing software. Here's a quick overview:

Here is the main editor. The main features are:
- naturally draw the level boundaries using the line tool (splines and lines)
- apply textures to "dress" the level (inspired from how I think they made rolando). The final exporter will clip those textures to the ground polygons. It helps greatly to break the repetitive pattern in dressing the level (we can show different parts of a texture depending on where it's placed)
- place physical objects around. For now there's: the lander, the landing pads, the turrets and the ball you have to carry around.
- draw the level bounding box so the camera never shows what's outside.


Once the .svg level is ready. I run a custom exporter written in C# to parse all the data (and convert the splines into lines with arbitrary precision). And then outputs an easy to parse level.xml file for the game

Every physical object is also designed inside inkscape. Here's for example lander.svg

The right drawing is the vectorial drawing of the lander.
On the left is a render of the drawing at the game's resolution. Around it is the physical shape of the object which can also contain additional properties to be used ingame. Here angulardamping is set to 0.9 and mass set to 1.
So again my C# exporter will export all this information into a convenient to parse lander.xml. When editing the level, it is sufficient to drop the rendered .bmp where we want the object to appear and the exporter will replace it with a reference to lander.xml in level.xml.

The game engine will take all these .xml files and run the level.

And here's the result on the iPad: