Pages

Monday 7 May 2012

The State of things

Having a menu system built was one of my top priorities, because well, that's the first thing the game has. When I started as a complete clueless game programmer, I thought that would be one of the simplest things. After having a few mini-projects built, none of which having a menu system, showed me that it was in fact one of the harder things.

It's because the creation of menus is tied to a key component of the code and that is the key to managing the state of the game. Once I read about it and understood it (or I thought I understood it), I just couldn't apply it, there was something missing. I tried understanding Microsoft's game state management project, and even though I could do simple things within it, if someone asked me to reverse engineer that, I simply couldn't. As I didn't know the thinking behind it when building it.
And I think reverse engineering any given code is important because if you can't, it means you don't know what it's doing and most of your coding later on will be based on luck or hours of frustration until you fumble into the solution.

So I did more and more reading and finally came across this amazing tutorial. There is not much to say about it other than it walks you through the process which is amazing. And it is a process that leads to an amazingly built clean and powerful library. It still took me some time to understand his explanation but the fact I now have a state management system that I can reverse-engineer is a great boost.

This is what you end up with after following the tutorial. As simple as it looks, it has a powerful code backing it.


It does lack one thing though, it doesn't set exercises for you to make sure you understood what he is doing.  So it is worth doing few exercises on your own. Like adding a screen from scratch that he doesn't have. Having menus go into other menus, or having a Exit game showing you a "are you sure?" pop-up. By end of Part 4 I could do all that confidently which is a testament to the strength of his "show code, explain code" method.

That is another thing done. Now I really need to figure out, as mentioned in the last post, what kind of project I actually want. Otherwise it's hard to code when I don't know what I should be coding. If nothing comes to mind it'll be a collection of mini-games that are different genres, or I might emulate an existing game in full somewhere down the line.

For now though, learning continues.