Fitting all of the code and assets into a 13 kilobyte package was difficult, but the end result was a simple, but fun, game about avoiding enemies in space. You can play it here.
The competition kicked off on the 13th of August, but it was not until the 9th of September that the idea of creating a space-themed game came to me. I wanted the objective of the game to be about maneuvering a spaceship, firing projectiles, and avoiding enemies and asteroids. Due to size restraints, I had to cut asteroids in the middle of development, but enemies and projectiles survived.
At one point, enemies would fire projectiles toward the player, but due to a bug involving the speed of projectiles versus the velocity of enemies, I had to remove them. I instead changed the behavior of enemies to ram the player, and then ultimately decided upon having them carry out individual kamikaze attacks.
What Went Right
- The graphics. Rather than load images from files, I opted to generate all of the graphics on the fly through the use of low-level calls to the graphics card. This resulted in simple graphics that did not impact the total file size, saving bytes for use elsewhere.
- Creating a parallax scrolling effect on the stars. The star fields are generated in separate layers, with each having its own "resistance" to the camera. When moving at slower speeds, the result is a subtle sense of depth.
- "Melting" the screen when engaging FTL. When the ship's FTL drive is repaired and is engaged, the canvas retains its contents between frames. This results in a sort of "melting" effect, which I think does nicely to convey traveling faster than light.
- Stars do not generate indefinitely. The implementation of parallax scrolling in the stars really complicated things. While the stars do go on for a good distance, they eventually run out. I had devised a solution to ensure that stars would generate indefinitely, but I did not have enough kilobytes to spare.
- The game is silent. When it was all said and done, I began working on sound effects, but by that point I had run out of bytes, so the game ended up being completely silent. I could excuse this as a pursuit for realism though, as there is no sound in space.