I have finished my GUI version of A.Q. Squares
and released it. This has been a couple weeks in the making. Since I released
A.Q. Squares I have been thinking about adding a GUI front-end. The problem I had was which one? While I have no problem running something in Linux, most people I know wouldn't be able to. So I would need a GUI that worked in both Linux and Windows.
Initially I looked at FLTK
. It was suppose to be very light weight and allow for static compiling into a single executable. That seemed like just the thing, but alas, while it worked fine in Linux I couldn't get it to compile correctly in Windows. So I abandon this route and continued my search.
My next tests were with OpenGL Utility Toolkit (GLUT), and more specifically freeglut
. This time I was able to get builds compiled and run just fine on both operating systems. With the compile working, it was time to create a user interface.
The implementation required a paradigm shift in the game state machine. With ncurses there was a main loop that waited for keystrokes before advancing. GLUT takes over completely once it is told to run. I could get callbacks from the library, but the state machine as it stood would not work. So I transitioned to an event-driven setup. The game state machine would be in a number of states (waiting for user to select a cell, waiting for animation to complete, etc). Each state advances when an event is received using a master event handler. The user interface then just fires off events for things such as key presses, clicks, and when timers go off. While a bit of rework was required, it wasn't a bad shift and I'm pretty happy with it.
The interface isn't 100% complete. There is no support for arrow keys and I would like the game to be fully functional with keyboard only. I've also toyed with the idea of having both the ncurses and GLUT user interfaces included. But like when I wanted release 1.0 to come out, I wanted 1.2 to go live.
This time, the distribution comes not only with source code, but two binaries for Windows: a 32-bit and a 64-bit. This should allow most other people to download and play the game. I currently have no method for compiling for Mac OSX, so no binary there. But this should be a good start.