Saturday, 30 October 2010

v1.0.5

I am still alive, but I'm having trouble getting the new build out. I keep having issues with the menus, and every time I think I have the solution and get the functionality back to where it was, I realise new problems have cropped up, which mean a new design and overhaul of huge chunks of code AGAIN. This is a causing me some frustration, as menus aren't the most exciting game element to put in, but I'm going to keep hammering away at it until I'm happy. In the meantime, here's a screenshot of the new game layout so far, which now runs in a 900x450 window:

Monday, 4 October 2010

Menus

Terrastrom v1.0.4 is well on its way, and with it comes prototype menus. This is proving particularly difficult to implement in a generic way, but it's coming along. I have created a Menu class, which hopefully will eventually deal with everything navigation.

I started working on this when I realised I will need pop-up menus for basically every interaction the game will ever do, so it made sense to get this done before continuing with the inventory. Hopefully soon we will begin to see several options when selecting a map object (e.g. talk, attack, pick up, info, etc), and similar when choosing a bag object (drop, eat...).

Because it works with delegates, a menu item can do essentially anything I can think of. This includes creating submenus, which I've just got working. When a new submenu is created, the focus swaps to it without removing the old menu, and the constructor automatically passes a reference to the parent menu, so it can deal with "Back" without having to store any info of how we got to where we are at in the menu.

It's not much to look at, but this was one of the cleverest pieces of code I've written so far so I'm pretty proud. It will feature fairly ubiquitously in the control scheme going forward. It's customisable so the menu panel images, spacing, text position and so on can all be unique to each menu, and it even has support for an optional sprite to go with the text (not shown here).