Here's a Christmas game in HTML5 canvas

It's Murray the Moose!

It's Christmas again, and time for something fun. Hopefully.

Having already built the basis of a simple game and with the desire to expand and improve it, inspiration hit the other week as to how that could be done. If you've already played the original, consider this a seasonal version 1.1 - with new graphics and sound effects!

It's called 'Murray T. Moose in Moose on the Loose: Too Many Jumpers (a Murray T. Moose Game)'. Enjoy.

How to play

The aim of the game is to get to the top of the screen, by hitting as many enemies as possible.

  • Move the mouse to position Murray along the bottom of the screen, and click to make him start moving up.
  • On touch screen devices, just tap where you want him to start from.
  • Each enemy has a level. So does Murray. If you hit an enemy with the same level, you beat them (and give them a lovely Christmas jumper). If you're a lower level, game over.
  • If you hit four enemies in a row, you level up.
  • The game also has special presents, all of which give you a level up bonus. Some of them also do interesting things...
  • To restart at any time, click again.

My high score is 462. See if you can beat it.

Story

If I was a proper game developer, I expect I'd write some kind of blurb to go with the game, like...

It's Christmas Eve, and Murray has once again been missed off Santa's sleigh team, despite knowing all about pulling sleighs and looking a bit like a reindeer.

Convinced that the reason for this was because he didn't fully enter into the festivities at the Christmas party (due to a brief stomach upset) Murray sets out to spread as much festive cheer as possible and prove he deserves to pull Santa's sleigh - by forcing everyone he meets to wear a colourful Christmas jumper!

Guide Murray through almost 3 levels of festive fun as he spreads joy and happiness before finally coming face to face with Santa himself. Will Murray's efforts be enough to please Santa, or will he turn his back? It's up to you.

Yeaaah, good job I'm not a game developer.

Technical stuff

The code's still a bit all over the place (there's some horrible inefficiences in the object handling, which I'm now fixing in another project based on this) but two big improvements are worth mentioning.

Firstly, I've modified the enemy movement graphics so that there's different graphics depending on whether the enemy is moving left or right. This wasn't really necessary the first time around, but having vehicles driving backwards and forwards on the screen necessitated it.

Secondly, thanks to Howler.js I've added in sound effects. They're not great but it's surprising how much of an improvement the addition of even basic sound makes. Thanks to mediacollege, soundbible and Sparky for the effects.

Code

The code's on github if anyone wants to take a look (please don't, it's still not great). Happy Christmas!

Post Christmas update

Apparently Murray's adventures didn't work on ipad, and were a bit slow on some other tablets. I think the ipad problem is to do with sound, so I've shoved in a fix to disable the sound if it won't work, but it's a bit difficult to check without an actual ipad. For me it breaks in Safari but not Chrome, so maybe try that.

I've not figured out the slowness problem yet, but I'm planning a complete code overhaul in the new year that should improve a lot of things. In the meantime, if it doesn't work on your computer, please let me know.

Related

This article is tagged with