Today my biggest goal was to get the level loader working. After that it was pretty much just polish - scores, lives, and increasing ball speed are all just extras
Finishing Up The Basics
|Final version of the title screen, with button blocks.|
Once these were working well, I got to down to business with the bricks themselves. I needed three types:
- A yellow block that disappears after being hit once.
- An orange block, that disappears after 2 hits and changes the colour of the ball when colliding
- A red block that disappears after 3 hits.
At that point, the basics were done. It was time to create the level loader.
The Level Loader
The first step to building a level loader was to decide what number of blocks would fit on the screen. I had the level automatically generate a bunch of blocks in a line going off into the distance, and counted. With my setup, it looked like about 17 blocks fit horizontally, and 23 fit vertically.
Next was to decide how to represent the level information. It seemed using simple numbers (1,2,3, and 0 for no block) separated by spaces might work best. While I was a little worried this would be an annoying and fiddly part of the development, it actually went quite quickly, and I was able to make some interesting designs.
|Level 1. My attempt at recreating the Ninja Kiwi logo.|
|Level 2. Not so subtle plug.|
After loading in the levels, the only thing still to do in terms of the level loader was making the levels transition after you beat them, and increasing the ball speed as they transition. I created a level transition dialogue to smooth this out, though I had some trouble getting it to not register mouse input to the ball while in the dialogue.
Now that all the main bits were in, it was time to add polish items. The first thing on the list was a lives system. Using the number "font" I made for the level dialogue, it was pretty easy to set up a lives counter. Next was to add a game over dialogue - I basically used the same system I had set up for the level dialogue.
Next up was a scoring system. With the life system already in, it was easy to add in scoring using it as an example. More difficult was the high score system, as I wanted this to store high scores in a file. I didn't want to implement a full font system so I decided not to include name entry, just a recording of the numerical score. As with the level loader, loading scores from file ended up being very simple. The file saving only took a small amount more effort, and a high score system was born.
At this point, pretty much everything I wanted to implement was in the game. I finally got around to adding sound when the ball collided, and improved a few other small things. I also went through and cleaned up my code.
Overall, I'm extremely proud of the result. It's one of the most complete games I've ever made and I did it all by myself, using no engines, in just three days. I'm absolutely exhausted but very happy!