Cube Jumpr!

Apple has famously flashed Adobe the ol’ digitus impudicus by abandoning Flash in all of its most recent i{*} products.

What this means from a business standpoint, I’ll leave to more intelligent and informed pundits 1 (modulo a digression later on, methinks)—but what it does of interest to me is throw Apple’s not-inconsiderable weight behind HTML5 for browser-based gaming. Accordingly, Darius Kazemi and Darren Torpey recently uploaded a series of tutorials for Akihabara, a JavaScript API for HTML5 games. While it’s still in its infancy and perhaps not fully-featured (I wouldn’t mind seeing mouse/touchpad input down the line, for instance), Akihabara’s one of the first such APIs out of the gate, and will hopefully encourage devs to experiment some more in HTML5.

Now, I’ll be the first to admit that I’ve never worked at all with Flash. That’s not to say that I never will (next on my list is to tame the wild FlashPunk), but the Akihabara tutorials popped up right around the time I was looking for something new to learn. To top it off, I’ve never worked much with JavaScript either (notwithstanding some recent tinkering in Unity), while I’ve been getting more and more interested in browser-based cross-platform gaming in general. All I needed was a modest project of my own to code.

Cue KJumpingcube, one of my favorite free, built-in Linux games. It has the mindlessness and simplicity of Minesweeper with a competitive twist, and massive end-game reversals are always fun to watch. Given that it’s horribly straightforward, it seemed a good choice to implement with Akihabara.

After about a week of intermittent coding, the game in its most basic form is available here, dubbed Cube Jumpr! in honour of its main inspiration as well as the vowel-challenged Web2.0 sites that I’ve grown to despise. Fun!

Cube Jumpr! makes use of the arrow keys and the ‘z’ key. Since Akihabara maps the external ‘z’ key to the internal ‘A’, you’ll notice a lot of “Press A to do something or other” prompts that actually require a ‘z’ press. That’s a feature I may be addressing in future releases. Or not. Also to be (potentially) addressed are some improved sprites, as well as possibly adding the aforementioned support for the mouse cursor and/or touchpads.

The rules are thus:

  • Players take turns clicking on individual tiles—either blanks or ones they already own—to increment the value contained within.
  • When a tile’s value becomes larger than the number of immediately adjacent tiles, these adjacent tiles are incremented and “claimed” by the current player, while the original tile is reset to a value of 1.
  • The first player to claim all tiles on the board is the winner.

As I say, the game is extraordinarily simple—my own implementation even more so—but it’s moderately enjoyable, and made for a good first project in Akihabara.

HTML5 gaming is no doubt going to have an uphill battle against the entrenched ecosystem of Flash developers, publishers, and players. To make things even more difficult, being written in JavaScript means (for the moment) that the games are publicly readable, and thus open-source and impossible to market commercially 2. But I’m still looking forward to seeing what the community will come up with, as APIs like Akihabara become more fully-featured and powerful.

1 The Internet: Truly, the natural, logical development of civilised Socratic debate.

2 “But Linux is open source and some people do market it commercially!” Yes, well, you know what I mean.