Post mortem: Volcanox
Volcanox was a lot of fun for me. Although a programmer, game development is not something I normally do. Additionally, it was also a test of the programming language MoonScript. I wanted to see if I could write a game in my own programming language.
The results, I thought, were pretty good. By the end of the competition I had something playable. I even had time to write music and insert sound effects.
If you haven’t played the game yet, you can do so here!
The Process
For this project I started with plain LÖVE. I figured I could get a foundation together. Even before the theme was announced I was pretty certain of making a platformer. It’s something I’ve never done before but I implementation ideas in my head. The first night was all writing collision detection code and movement. This was the one thing I was certain about writing, so I plowed through it. I even had time to write a map loader
I implemented an algorithm called Uniform Hash Grid, which let me subdivide my collidable objects to reduce the number of checks per frame. This worked very well, I was able to create a huge map with no impact to runtime performance. (It had a little load time though, which I think I could improve if I had more time.)
My map loader just loaded a bitmap where pixels represented collidable tiles. I did this to avoid having to use any real map editor tool. In my code I assigned colors from the map image to be actual tile sprites. This was my first map:

From there I just added gravity, and assigned a jump button and I had a working platformer.
I spent some time fooling around with ideas. I wrote a basic particle system which I later used for all the shooting effects.
The next day, after waking up I decided to tackle something I thought would be very hard, drawing sprites. I put together a simple (and awful) animated player sprite:

After that though I kind of lost sight of what I wanted to create. I had a working system, but I didn’t know what kind of game to create. I got lazy and went out to a coffee shop with friends. I think this was unavoidable because I needed time to think. After that I decided I would have shooting and enemies so I started coding bullets. I added minor things and created a tile set. Things were looking okay but I still didn’t have a game mechanic.
On the last day the name Volcanox finally came to me. I coded up until 1 hour before the deadline adding simple game features like title screen, and winning and losing conditions. I added one enemy and wrote the AI. I had no experience writing something like that so it came out very unnatural. I decided that because the game was so simple, I would make the enemy spawning very aggressive. This actually made the game (annoyingly) hard. I expanded the map to make it huge and have lots of enemy spawners.
Here’s the final map: (yes that’s a volcano)

The last hour I rebooted into OSX and recorded some music on my keyboard, and quickly got some sound effects out of bfxr. I submitted my game at exactly 6pm.
The final submission’s source code is on GitHub.
Review of MoonScript
Part of this project for me was testing how well MoonScript would work for game development. MoonScript is a language that compiles into Lua. It’s a slimmed down syntax that adds a lot of sugar. Things like classes, list comprehensions, and a lot of other useful stuff. It works great with LOVE.
I wrote 1534 lines of MoonScript, and it compiled into 2880 lines of Lua. Pretty cool!
I heavily used the class system, and the inheritance it provides. It allowed me to quickly scaffold objects in my game. I think if I were writing Lua, a lot of time would be spent designing my object interaction. In that regard, MoonScript was an excellent tool to use.
I strongly recommend it for game development.
What went right
- Using MoonScript
- Using a bitmap and gimp as my map editor
- My tools all worked well together
What went wrong
- Didn’t test on windows, got report of people having issues after submission
- Didn’t know what I wanted to make in the middle of the comp
- Didn’t have any foundation code, had to focus more on getting code to do basic stuff instead of adding game features and polish.
Once again, If you haven’t played the game yet you can do so here!
Tags: lua, post-mortem, postmortem, screenshot, tools
