One Broken Pixel

Roll the Dice

Things to do:

  • Learn Javascript
  • Try out Phaser
  • Get comfortable with putting stuff online

To that end, here’s something short I wrote to try out Phaser. Click the dice to make them roll.


To get the roll effect I used a blur filter in combination with spritesheet animation and random rotation. The dice extend Phaser.Sprite so that they can manage their own values. With all the examples available on the Phaser website, it was fairly easy to work out what was needed (working out the intricacies of Javascript on the other hand…).

All the code is available on github, and in the rolling_dice folder specifically.

Where to now? A game of Yahtzee perhaps?

Comments