Saturday, March 04, 2006

Taking shape

I started getting some of the stuff from Allegro's test.c going but very quickly got bored of that so I've started some actual work on the game itself.

There's a main loop going that attempts to run an update function 60 times a second and render the screen as often as it can. (I'm not convinced my version is working quite how I expect it to though!) I've got a very basic 'button' class that monitors the mouse and works like a button in a GUI. There's also the simple first-pass at the game logic - storing a minesweeper grid and calculating the number of neighbouring mines and that stuff.

Something that struck me while writing this is just how natural it feels to work with lexical scoping. I didn't really think about the fact that I was passing closures to an 'onclick' style function in my button object - it just turned out that way after I wrote it the first way I thought of. Very nice.

I'm also looking into setting up somewhere to host the source for the allegro / cffi stuff.


Post a Comment

<< Home