See below for download links and pre-Github version history.
Please feel welcome to use the Issues feature on Github to report bugs, suggest improvements, or request features.
Latest Version - 2.7 (2018-01-03)
Click download now to download
the latest version from Github.
See Winwheel.js on Github
- Removed unnessary step in the drawing code and changed all rendering to use 'canvas' rather than internalCanvas or externalCanvas. etx property of the wheel is gone now too; ensure you use ctx to get the context of the canvas the wheel renders to.
- Improved rendering of Pointer Guide.
- Fully completed all class references!
- Added section on the Pointer guide to the tutorials.
- Minor additions and changes to some tutorials (correct typos etc).
- Got clearTheCanvas working as expected and some other minor code tidyup.
- Fully completed Animation - more details page.
- Finally released Winwheel 2.0 and the new version of the site even though not 100% complete.
- Removed the version history from the top of the winwheel.js file and placed on this web page.
- Corrected minor incorrectness with with the final endAngle in the prizes array. Should be 359 not 360.
- Added an angle_guide.png image to the downloadable source to assist in working out the start and end angles of the prize segments for the Prize Detection and Predetermined features, or just to make it easier creating prize wheel images.
- Added "Pre-determined" feature which allows the result of the spin to be predetermined by a server side process, or other code, then when the wheel spins it will stop at this pre-determined location or prize rather than a random one.
- This required changes to the spinning code so instead of counting down until no rotations left it spins upwards until the target angle is met. Also needed to change the code that works out the power to just set the power level; the new startSpin() function sets the targetAngle based on the power.
- Decided to improve the slowdown code by adjusting the way the thresholds that change the amount of angle rotated by are calculated. They now work on the principle of how close the currentAngle is to the targetAngle.
- Added ability to reset the wheel by adding resetWheel() function.
- Overhauled the declaration of the global variables, moving ones that developers can alter to the top, and moving ones that should not be altered to seperate section. Also updated most of the comements describing what the variables do.
- Added check that power level is selected before the wheel will spin (previously you could click Spin with no power selected) and also added variable to store the current state of the wheel - if spinning or not - so click of spin button while wheel is already spinning has no effect.
- Added "Prize Detection" feature which works out the prize the user has won when the wheel stops. As part of this I changed the wheel graphic to contain less segments so easier to understand.
- Original version created based on earlier project for work social club.