Here’s a neat trick I discovered today while working on Iridescence.
Haxe has native macros that are very different from those found in C; rather than using a separate pre-processing language, Haxe macros are simply snippets of Haxe code that are run at compile time instead of run time.
In native builds, Iridescence populates its soundtrack dynamically by searching for all song files in the /assets/music folder. On more restrictive platforms like Flash, all assets have to be known at compile time so they can be embedded in the SWF, which meant I needed to create a list of files manually and update it whenever I added a new song. I wrote this little macro to iterate through the music folder at compile time and build a list of song files automatically.
macro public static function getSongList(extension:String)
var songs = FileSystem.readDirectory("assets/music")
.filter(function(s) return s.endsWith(extension))
.map(function(s) return "assets/music/" + s)
return Context.makeExpr(songs, Context.currentPos());
With core mechanics solidly in place, I thought it was high time to give Iridescence’s art some attention. Here’s what I’ve been working on today.
There comes a point in the life of every creative person where you create something that feels like the culmination of your craft. It’s your magnum opus, and you’ll never make anything better.
The Heroes’ Tourney felt that way for me. It’s a “couch multiplayer” game for 2-4 players in which you try to punch your friends off of platforms or into environmental hazards.
It started in a 24 hour game jam held by SNHU, a college here in New Hampshire. Chris, Mike, and I had decided to make a local multiplayer game and had the basic groundwork up and running. At some point around 12 hours in, Chris and I woke Mike up with our laughter over the absurdity of a certain bug with the physics, and we decided to build the rest of the game around that. The rest is history.
The 24 hour deadline rolled around and our game was a smash hit, despite being nowhere near finished. About a week later, we all met up again at a game jam at NHTI and somehow decided to continue work on THT instead of creating a new game from scratch. This new version included a powerup system that added a whole new dynamic to the gameplay. We had a mini tournament during the wrap up session and it was incredibly rewarding to see other people laughing and taunting each other while they played.
I’ve done some more work on the game since then and we still plan to work on it in the future, but I think it’s finally ready to be thrust out into the world to see how it fares. You can download it here. Make sure to read the readme, and yes, controllers really are required.
Here are some action shots from our post-thanksgiving dinner tournament.
And here’s my little sister playing against my cousin’s girlfriend.
It’s always fun to add a new system to a game, minimal and naive, with a blissful ignorance of the bloated monster that it might someday become.