Falldown now has a working graphical menu! It looks like this:
Ok, fine. Calling the menu “graphical” might overstate its visual appeal at this point. I have yet to put in a title graphic or an options/configuration menu. But still, that simple screenshot represents a lot of work.
To create the menu, first, I had to fire up the GIMP to design the menu art. For now, I am keeping it simple; the art consists of the words “Play Game” and “Exit” as large textboxes, which I exported to PNG image files.
With art assets in hand, I researched how to (A) load the image files using SDL_Image and (B) convert the images into a format that OpenGL would play with nicely.
After all that, I updated the game’s state management, so it would know whether you (the player) were interacting with the main menu or playing the game. Based on that game state, the game logic would respond differently to mouse clicks/key presses.
To round it all out, I made a few large tweaks to the game’s memory management. The tweaks ensure that the game uses memory for the main menu’s image files only when it needs to display them. The tweaks also make sure that the game properly allocates and releases the memory used by the ball, the rows, and other under-the-hood data structures, as you switch back and forth from the main menu to the game.
But a picture is worth a thousand words, and a video is worth a thousand pictures, which is 1,000,000 words. With that, here are those words:
I still have quite a bit left to add, such as sound, music, graphical effects, levels, scoring, etc. I also need to update the menu/user interface to allow decision confirmations (e.g., “Are you sure you want to exit?”) and game saves.
But more important than the stuff that is missing is the stuff that is present: Falldown is built on a hand-crafted game engine. So far, writing this game has taught me valuable lessons about “tangibles,” like software project management, source code management, and testing/debugging. It has forced me to learn a few things about system memory management, game state management, geometric reasoning, collision detection (both static and dynamic), and user input management. Lastly, it has also taught me about some intangibles, such as design and decision-making.
Or, in short, working on this game has been awesome so far, and I will definitely keep working on it. Stay tuned!