This is a pretty simple plugin that turns any container into a customizable dice game.
$('#container').dice();These settings may be changed:
| Option | Default | Description |
|---|---|---|
| numPlayers | 1 | This defines the number of players for this game of dice. Each player will roll the dices, the results will be compared. This number has to be higher than 0 (zero). |
| numDices | 1 | The number of dices each player uses. This number has to be higher than 0 (zero). |
| maxSpots | 6 | The maximal number of spots a dice can show. This number has to be higher than 0 (zero). |
| trickReaction | reroll | How should the game react if two players have the same result. By default these players will have to reroll their dices. Possible values: reroll, ignore. |
| rollDice | return parseInt(Math.random() * settings.maxSpots, 10) | Returns a random value for a dice. You may use a more sophisticated function for this if you like. |