I made a game! I’ve been working on it on and off for about six months, between work and freelance projects, and it’s finally ready enough to be released.
It’s called Cubed, and it’s probably best described as a 3D action-puzzle game – think Bejewelled meets Rubik’s Cube. You have to turn sections of the cube to make groups of three or more cubes of the same colour, then click them to remove them from play.
More cubes appear to fill the gaps over time, and the higher your score goes the faster the cubes appear – then when the main puzzle is full you’ve got five seconds to clear some space before it’s game over.
It’s always hard being objective about your own projects, but I’m pretty pleased with it overall. I find that when I’m testing it I often start actually playing it for real, which I think must be a good sign…
It’s built in Flash using the Away3D library, which is powerful but seriously lacking in documentation; I spent a good few nights trying to work out the difference between project() and unproject() and figuring out how transformation matrices worked, with very little support from the library. Once you do find the right function to call, though, it’s pretty easy to set up cameras, light and textures.
I’m in the process of porting it to iOS, which has mostly been fine – the actual process of exporting it for iOS (after struggling through Apple’s ridiculous Developer Program nonsense) is pretty straightforward. What caused me several late nights, though, was the change from mouse events to touch events.
I don’t know if it’s an artefact of Air for iOS, or Away3D, or the specific interactions I was trying to create – or a combination of all of the above – but I encountered a really frustrating bug. I could touch and drag and lift, and that all worked fine, but when I next touched the screen the MOUSE_DOWN event registered at the place the previous MOUSE_UP event triggered.
This was such a weird bug that it took me a while to realise what was actually happening, and then even longer to try and work a way round it. I ended up dumping MOUSE_DOWN events altogether, and substituting MOUSE_OVER instead – when the user touches the screen the “cursor” jumps to that spot, triggering the event.
This worked fine until I installed the Air 3.5 Beta SDK, which broke MOUSE_LEAVE and MOUSE_UP events, and gave me another sleepless night until I realised the SDK was the problem and went back to 3.2. I’m probably missing out on exciting new functionality, but it just wasn’t worth the hassle of having core functionality broken!
UI-wise, I’ve tried to keep everything really stripped back and simple, focusing on interesting interactions rather than complex gameplay mechanics. One big challenge was working out the user’s intention when turning segments of the cube: there are three possible interactions for any cube, turning in X, Y, or Z, and since input devices only function in 2D I have to set rules about what happens when you move the mouse a certain way.
The game projects your movements into 3D space and tries to guess which way you’re trying to spin the cube. This is guesswork, ultimately, but I think the results are generally pretty consistent, and when I’ve watched people play Cubed they pick it up quickly. In general, the iOS version is even better at this, because it removes the mediation of having to interact with the mouse. There’s something really nice and tactile that makes playing on a touchscreen more immediate and more satisfying.