Thursday, September 22, 2011

Interfacing

After a couple of weeks of dredging through 'ground work' I've finally come out above ground level. I've got the inner workings of my 'Interface' class working properly and it's looking to work pretty well! Right now it handles just panels and buttons. The window manager knows how to draw 'em in all their states (like, if you mouse over a button etc.) And the proper 'hooks' are in place to connect buttons to certain events.



Initially I was going to have the buttons 'perform events' by providing them with a function pointer to the function they need to execute, an idea by a friend of mine. However I found, having implemented most of this already, that function pointers cannot point to parenthesized functions. Quite a problem considering most of my code is designed with a reasonably strict class hierarchy. The interface class, for instance, doesn't 'know' about any of the higher level classes like those part of the Editor.

In stead of this method I decided to do a crude implementation of an 'event' structure. I have an array of booleans which correspond to 'actions'. A button is supplied a pointer to a particular boolean, this defines which action it'll perform when pressed. After the interface has been handled each cycle, the Editor will see if any of these booleans where set to true and then perform the function associated with that boolean. Pretty simple stuff.

The next step will be to design the UI using my existing (and probably some new) Interface elements and hook it up to functionality. Most of this will rely on the foundation I've been building the past few months.

Also, good news for me and anyone keeping track of this, I recently took an internship in a nearby town and thus will have a regular commute over there and back. This provides ample opportunity to do more coding. Couple this with the fact that I'm back into 'not boring foundation work' zone and it should make for some productive times!

Until next time!

Tuesday, September 6, 2011

Still Alive...

This is just an update to let everyone know I'm still alive and work on CubeWars is still ongoing.

Most of the work is currently going into the Editor at the moment. I'm working on a redesign of the Interface class and the way it's going to work in both the Editor and the Game itself. There's not a lot to talk about since it's very basic stuff, which is also why it's taking me so long. Doing it right is going to make my life easier down the road though.

I don't have a real estimate on when I'll have this done but judging by how long it's been taking me it could be a few weeks, though work has been picking up pace in the past week!

I'll try to post updates here whenever something mentionable happens, it's just difficult in this stage because most updates of the past week would've been stuff like "this class now inits properly" or "I made a change and had to fix the destructor, it works fine now though" which isn't particularly interesting to read for anyone not working on the thing.

Anyway, I'll hopefully post another update soon!