Skip to content

christianhanne/jquery-dice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQuery Dice

This is a pretty simple plugin that turns any container into a customizable dice game.

Usage Example:

$('#container').dice();

Options:

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.

About

This is a pretty simple plugin that turns any container into a customizable dice game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published