But I wanted something different, something more original, so I decided to make it a mash up of Arkanoid and reverse Space Invaders. And thus was born,
Space Invaders! (further research showed that it was quite similar to
Orbient as well)
I started making art for it that very night. Art was the ultimate cause for demise for my other project so I decided to do it first this time. I made a simple spinning globe in 3 hours (though in retrospect, I would’ve done in half the time) and began work on the enemies the next day. There was very little art to do so I was done within the week.
Art!
Next came the fun part, creating the game engine. I decided to write my own collision detection system for this game.My experience with Box2D proved very helpful. Without going into too much detail, an object is added to the collision list and every update, the system checks if it is with in the earth, if it is the a thud sound is played and other magical score related things happen. It also checks if the object is within a ring around the earth or not and compares it’s angle of impact to the paddle’s angle, if both return true then a successful block is triggered :]
Very simple, very fast, very easy
Dynamic Sound generation was easy because there were quite a lot of already available on the interwebs (although I have yet to see a game to use this!) I eventually found one that generated square waves which were perfect. Great read here. Look for a demo half way down the page. Once that code was in, I played around a bit with random pitches witch was in the demo because I wanted XML Parsing in first.
XML, one of the best resources to use ever. Basically you get to create you own file format, no fuss. Kirupa has a good introduction for this. Each XML will contain a number of songs, and each song i turn will contain a number of notes. Finally each note has an unique ID, starting point, pitch, length and origin. Simple enough, a new array is created of each song with the notes in it.
Now all that’s left is for a switch to take in the pitches and input the correct frequency into the sound generator. This handy diagram helped. I decided to restrict the switch to accept values from C3-B5 which should be enough for songs, besides entering more values are easy enough.
GFX was interesting. To make it more obvious that enemies were firing, I decided to give each bullet a glow effect when firing, made an new class for this. Nothing worth noting.
FUN PART READ THIS IF YOU SKIPPED EVERYTHING ELSE.
User created CONTENT, That’s right, user’s get to create their own songs. Planning to include a simple one track sequencer that spews out the XML, shouldn’t be too hard. Won’t have a mp3 track playing under it like stock songs but it’ll be usable.
That’s all folks next post will probably an in depth look at collision detection.
Remember to comment on what you’d like to see next!