

Therefore stopping anywhere between 21 will give you the ‘3’ wedge. Because there are 6 sections (360 / 6 = 60) each section is 60 degrees. The ‘switch’ statement evaluates eRot and determines what to set ‘prize’. Therefore the arrow will spin five times and then stop somewhere between 1 and 360 degrees. So 360 x 6 = 2160 and add another 360 gives you a range between 21. Why 2160? I wanted the arrow to rotate 6 times before stopping. When the script is executed, the variable eRot is assigned a random number between 2160 – 2520 and evaluated in a switch statement. There are two main principles used in this script – the animation and the random number. ], Explanation of Javascript (for those interested ) On press Execute the following javascript:

I will attempt to explain a little bit of the javascript at the end. As a warning this tutorial uses a lot of javascript and some basic geometry. There are lots of ways to modify this method, and of course change the design to look much nicer.
Custom random spinner how to#
This blog tutorial covers how to create your own animated spinner.
Custom random spinner series#
You could also have a scenario where you offer series of challenges or obstacles that are randomly selected. Each board square would offer different challenges, information or rewards.

Or you may have designed your learning as a board game that requires learners to ‘randomly’ travel across a board. For example, your design might include a point system, and every correct response the learner gets a change to spin a wheel to earn a random amount of points. There are lots of fun ways to include randomness into your learning interactions.
