The title says it all. The JavaScript Animated D6 Dice Roller was previously made available under open source licenses, but has now been released to the public domain via a CC0 Public Domain Dedication. If you have the urge to include an animated D6 dice roller in any JavaScript-based game, for any purpose, commercial or non-commercial, then grab a copy of the public domain JavaScript Animated D6 Dice Roller package and let it do the work for you! Okay, you have to install it and write code that makes calls to it, so look for the links to the tutorial and documentation on the download page.
I’ve added sample JavaScript and HTML files to the package, showing how you can build a DARO dice roller. (DARO = Doubles Add and Roll Over.) The interesting stuff is in daro.js. When you unzip the JavaScript Animated D6 Dice Roller zip file, look for the daro.html file; run it to see the DARO effect. Or you can try it right here.
Keep rolling until you get doubles.
The JavaScript Animated D6 Dice Roller is amazing. Thank you.
You’re welcome! I hope you are able to do amazing things with it!
D6 Dice Roller is amazing.
But i want to animate Dice like given below link. can u help me?
https://github.com/lazygyu/jqueryDice …….
Hi, Shoaib. I’ve not used the jQueryDice plugin, but it looks straightforward. On the page you linked to, there’s a Demo link at the bottom of the page. Maybe you saw it. If you go to the demo page, you can view the source of that page to see how they set it up. Mimic that and change it to suit your needs. Hope that helps.
Michael above mentioned demo has no multiple dice roll option like d6 animator. i want throw animation in d6 dice roll. can u put
that animation in d6 dice roll.
Hey, Shoaib. I don’t want to take away the fun from you or the opportunity to learn by doing. Moreover, there are licensing issues involved that prohibit me from combining code from the two sources and distributing it as public domain code. Can’t be done. So I have to leave it to you to create what you will for your own use. If you’re motivated enough, you can do it. Good luck!
wow amazing roller with nice rolling effect…!! thanks
You’re welcome. Glad you like it and hope you can make good use of it.
https://docs.google.com/drawings/d/1EN1NTOWX0fB8DQIG1jcj8-4Ke5cULQKy-WyJHz_XMWQ/edit?usp=sharing
This is odd good sir!
Did you doctor the image, or is that for real? What OS or device are you on?
Hi, I found a little bug :S
it happens when you get same face on every dice like:
1,1 – 2,2 – 3,3 – 4,4 – 5,5 – 6,6
it just dont stop rolling but it re-roll the dice and add the new result to the previous one.
Hi, Grayfox, and thanks for stopping by.
The sample embedded in this page is intended to re-roll the dice when doubles are rolled, as stated. That was done on purpose, so it doesn’t qualify as a bug, but as a sample usage of the software. When you use the JavaScript library in your own projects, you don’t have to set it up to re-roll doubles. That’s entirely up to you.
Thanks for your answer, i was a little confuse but now it’s all clear. Works like a charm 🙂
Thanks for your sharing 😀
No problem. Glad to help. Thanks for stopping by my little corner of the web.
Thatz a kool animator dice program what you have developed. I liked it. Although I wanted a program which has 4 dice. Every dice has only two sides with 0 and 1 dots on it. The roll should result in 1,2,3,4 as regular score and 8 as dice score when all 0’s come on the dice roll. Please suggest if you may.
Am trying to develop a non commercial traditional Telugu people’s game for academic purposes.
Thanks in advance
Pradeep
Hi, Pradeep, and thanks for your feedback and request.
To do what you need, you’ll have to tweak the code and supply new dice images.
1. Create new images for the two-sided dice. You’ll have four images, one for 0 at rest and one for 0 in motion, and likewise with 1 at rest and in motion. Name these images according to the image file name patterns I used for the results 1 through 6, but using 0 and 1 instead of 1-6.
2. For the code, you can modify the code that is producing a result from one to six. Before it processes/saves off the random number, simply mod the result with 2, and let that be the value processed/saved. The higher level classes that make use of the generated random number should handle it just fine.
Without trying the above, I can’t say 100% for sure that’s all you’ll need to do, but I think it should be. To get the right number of dice, you’ll set that in the configuration of the dice roller. Hopefully the dice-roller documentation available on this site will suffice to instruct you on that detail.
Good luck! I’d like to hear of your progress, if you don’t mind.
Awesome work!
Hey, Dennis. Sorry for the late reply. I was sick back when you posted. Thanks for the feedback!
Hi, two tumbs for this very good javascript but how we can trick and threat the output with my own number?
Hey, Zugaikotsu. Thanks for your comment.
To use your own numbers as results of the dice animations, you’ll need to use either the D6Animator class (for a single die) or the D6AnimGroup class (for multiple dice). Documentation for these classes can be accessed at http://eposic.org/samples/dice/docs/index.php. In particular, look at the “start” methods of those two classes. Hope that helps!
really good, Sir.
Hope will be to see more.
Regards,
Thank you, Thoai! Glad you like it.
Hi Michael K. Eidson, I would like to ask the dice roll random = current time
D6Animator.prototype.initSeed = function() {
var now = new Date();
this.seed = (this.seedMod + now.getTime()) % 0xffffffff;
}
Now, i want edit : var now = new Date() + 60s
And I want after 90s Dice auto Roll.
Pls support me. Thanks
Hi, Khang,
The license allows you to make whatever changes you need to the code and use it in any way you desire. Since you know what you want, go ahead and make those changes yourself. The license allows it. Cheers!