Friday, March 1, 2013

Pat's Dice

Before I finally go to bed, one more exciting announcement:

A while back I made a virtual dice simulator named "Pat's Dice" (After the alchemist character I was playing in a dungeons and dragons campaign.) to teach myself some javascripting in Unity.

It turned out to be quite an undertaking, but having no scripting experience at all I learned a lot of fundamental concepts and started to get pretty comfortable with the process (Though my workflow still involves long talks with my friend Google).

My basic goal was to create a dice simulator that was driven by a physics engine but still perfectly randomized. The dice all spawn with randomized velocity and starting angle, and some custom scripts determine which side is facing up and feed that number into the GUITexts following the dice. Those numbers then get fed into the appropriate totals.

There was a lot of making arrays and parsing strings into integers and back again; but I'm proud of the accomplishment, since mere months ago I didn't know any of those terms. Most recently, along with some spit and polish on the art, I added the most-requested feature of launching multiple dice at once; as determined by the up/down arrow buttons.

Long story short: you should check it out. You can click here, or just click the page link at the top of the blog.

And with that, I'm off to make some pretense that I am not completely nocturnal. Later!


UPDATE: After some excellent bug testing by my friend Jeff, I have updated the html frame to extend for larger font sizes. If yours wasn't working, try it out now.

No comments:

Post a Comment