jQuery Dice

Don't look at me like that. I know what you're thinking... "Seriously a dice game? How creative. How do you come up with all those new ideas?" Yeah, I know. It might not be the holy grail of game development. But I was bored and I had nothing better to do. So here it comes. Yet another jQuery Dice game the world hasn't been waiting for.

Obviously this is a very simple plugin. You just need to create a container and then run dice() on it. You can define several different settings. The number of players, the number of dices and the maximum number of spots on the dices. The "game" will start after the user clicks on the container and determines a winner for the game. Basically the player with the highest value wins.

$('#game').dice({
  numPlayers : 2,
  numDices : 4,
  maxSpots: 6
});

If two players role the same value, the default reaction of the game is to roll the dice for those players again. You can change this behaviour through another setting. Also you can overwrite the default dice rolling method, which uses by default a very simple pseudo-random method.

For more details check out the repository on Github or the demo below.

There are no comments yet.