Created: 10/7/2017
By: demonisblack
Email: demonisblack@gmail.com
Thank you for purchasing my game. If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!
Lucky Wheels is a HTML5 game where you spin the wheel to win the points, it come with 2 wheels where it give a second chance to bonus up the score or loss it all.
The ZIP package contains the game with 1280×768 resolution that scales to fit the whole screen device, but it may not be perfectly full screen.
How To Play:
1) Spin the wheel or tap on the spin button to play
2) You have total 7 ticket chances to get high score



To install the game just upload folder 'game' to your server. The game won't run locally with some browser like Chrome due to some security mode.
You need a website that runs PHP to make facebook share button work, and make sure to change Facebook Open Graph meta and Twitter meta in index.html, just replace [GAME_URL] to your game URL.
<!-- for Facebook -->
<meta property="og:image" content="[GAME_URL]/share.jpg" />
<meta property="og:url" content="[GAME_URL]" />
<!-- for Twitter -->
<meta name="twitter:image" content="[GAME_URL]/share.jpg" />
You can easily customize game text and settings in game.js file
var enableFixedResult = false; //option to have fixed result by API, enabling this will disable 2D physics engine
var enablePercentage = false; //option to have result base on percentage, enabling this will disable 2D physics engine
var spinDirection = true; //true to spin right, false to spin left
var spinSpeed = 18; //wheel spinning speed
var touchSpin = true; //touch to spin (true/false)
//status display text
var statusText_arr = ['SPIN YOUR FOTUNE','SPINNING...','[NUMBER]PTS', 'WIN [NUMBER]PTS', 'BETTER LUCK NEXT TIME!', 'JACKPOT [NUMBER]','YOU LOSS ALL POINTS'];
var defaultStatusBgColor = '#655643'; //status bacgkround color
var creditText = '[NUMBER]PTS'; //point display text
//game play type; true for game1, false for game2
var gamePlayType = true;
//game1 (spin using chances)
var gameChance = 7; //total chances
var chancesText = 'x [NUMBER]'; //chances display text
var instructionTxt1 = 'You have total 7 ticket chances,\nspin the wheel or tap on the spin button to begin.'; //instruction
//game2 (spin using bet number)
var gameBetPoint = 500; //total bet point
var gameCanBet = 10; //total bet increase
var gameMaxBet = 1000; //max bet
var instructionTxt2 = 'First place your bets,\nspin the wheel or tap on the spin button to begin.'; //instruction
//wheel radius
var firstWheelRadius = 230; //first wheel radius for slot color feature
var secondWheelRadius = 100; //second wheel radius for slot color feature
var wheel_arr = [{src:'assets/item_wheel_01.png', highlight:'assets/item_wheel_01_h.png', color:'#FDCC09', regX:1, regY:223, point:10, type:0, percent:30,
slot:{
color:'#FDCC09',
highlightColor:'#FFE600',
stroke:5,
strokeColor:'#fff',
fontSize:45,
lineHeight:45,
text:'10',
textY:140,
textColor:'#fff'
}
},
{src:'assets/item_wheel_02.png', highlight:'assets/item_wheel_02_h.png', color:'#F37621', regX:1, regY:223, point:25, type:0, percent:25},
{src:'assets/item_wheel_03.png', highlight:'assets/item_wheel_03_h.png', color:'#7DB544', regX:1, regY:223, point:50, type:0, percent:20},
{src:'assets/item_wheel_04.png', highlight:'assets/item_wheel_04_h.png', color:'#1A9DD8', regX:1, regY:223, point:80, type:0, percent:15},
{src:'assets/item_wheel_05.png', highlight:'assets/item_wheel_05_h.png', color:'#3F559A', regX:1, regY:223, point:100, type:0, percent:15},
{src:'assets/item_wheel_06.png', highlight:'assets/item_wheel_06_h.png', color:'#91328B', regX:1, regY:223, point:1000, type:0, percent:15},
{src:'assets/item_wheel_07.png', highlight:'assets/item_wheel_07_h.png', color:'#449BD4', regX:1, regY:223, point:250, type:0, percent:15},
{src:'assets/item_wheel_08.png', highlight:'assets/item_wheel_08_h.png', color:'#F37621', regX:1, regY:223, point:500, type:0, percent:15},
{src:'assets/item_wheel_09.png', highlight:'assets/item_wheel_09_h.png', color:'#FDCC09', regX:1, regY:223, point:25, type:0, percent:25},
{src:'assets/item_wheel_10.png', highlight:'assets/item_wheel_10_h.png', color:'#7DB544', regX:1, regY:223, point:0, type:0, percent:25},
{src:'assets/item_wheel_11.png', highlight:'assets/item_wheel_11_h.png', color:'#DA2027', regX:1, regY:223, point:1000000000, type:2, percent:5},
{src:'assets/item_wheel_12.png', highlight:'assets/item_wheel_12_h.png', color:'#475C70', regX:1, regY:223, point:0, type:1, percent:5},
];
//second wheel segments
var secondWheel = true; //option to display second wheel; (true/false)
var wheelSecond_arr = [{src:'', highlight:'', regX:0, regY:100, mutiply:1, percent:30, slot:{
color:'#53709D',
highlightColor:'#6386BF',
stroke:8,
strokeColor:'#fff',
fontSize:35,
lineHeight:35,
text:'x1',
textY:60,
textColor:'#fff'
}},
{src:'assets/item_wheel_inner_03.png', highlight:'assets/item_wheel_inner_03_h.png', regX:0, regY:100, mutiply:2, percent:10},
{src:'assets/item_wheel_inner_01.png', highlight:'assets/item_wheel_inner_01_h.png', regX:0, regY:100, mutiply:1, percent:10},
{src:'assets/item_wheel_inner_04.png', highlight:'assets/item_wheel_inner_04_h.png', regX:0, regY:100, mutiply:0, percent:10},
{src:'assets/item_wheel_inner_02.png', highlight:'assets/item_wheel_inner_02_h.png', regX:0, regY:100, mutiply:2, percent:10},
{src:'assets/item_wheel_inner_05.png', highlight:'assets/item_wheel_inner_05_h.png', regX:0, regY:100, mutiply:1, percent:30}];
var resultTitleText = 'GAME OVER'; //result title text
var resultScoreText = '[NUMBER]PTS'; //result score text
var exitMessage = 'Are you sure\nyou want to quit?'; //go to main page message
//Social share, [SCORE] will replace with game score
var shareEnable = true; //toggle share
var shareText = 'SHARE YOUR SCORE'; //social share message
var shareTitle = 'Highscore on Lucky Wheels Game is [SCORE]PTS.';//social share score title
var shareMessage = '[SCORE]PTS is mine new highscore on Lucky Wheels Game! Try it now!'; //social share score message
wheel_arr array place all the slots, below is the explanation of each most important wheel_arr array item:
wheelSecond_arr array place all the second wheel slots, below is the explanation of each most important wheelSecond_arr array item:
1. First enable the option below in game.js
var enableFixedResult = false; //option to have fixed result by API, enabling this will disable 2D physics engine
2. Call function getResult(wheelNum, wheelInnerNum) to set result, by default -1 is to
randomize, or any index number from wheel_arr and wheelSecond_arr array, eg 0
to 11.
getResult(8,-1);
1. First enable the option below in game.js
var enablePercentage = false; //option to have result base on percentage, enabling this will disable 2D physics engine
2. Set winning percentage on each slots in wheel_arr and wheelSecond_arr in game.js
1. Add new slot attribute settings to draw the slot shape like below.
{
src:'',
highlight:'',
color:'#FDCC09',
regX:1,
regY:223,
point:10,
type:0,
percent:30,
slot:{
color:'',
highlightColor:'#CB6907',
stroke:5,
strokeColor:'#fff',
fontSize:45,
lineHeight:45,
text:'10',
textY:140,
textColor:'#fff'
}
},
2. You can change the drawing radius in game.js
//wheel radius
var firstWheelRadius = 230; //first wheel radius for slot color feature
var secondWheelRadius = 100; //second wheel radius for slot color feature
The sound can be easily disabled to avoid compatibility issues in sound.js file:
var enableMobileSound = true;
The mobile rotate instruction can be easily change in mobile.js file:
var rotateInstruction = true; //enable rotate instruction for mobile
var forPortrait=false; //for portrait only, set false for landscape mode
The page start with the loader wrapper that covering the whole screen in the body. It shows loader progress when calls the function initPreload()
<!-- PERCENT LOADER START-->
<div id="mainLoader"><img src="assets/loader.png" /><br><span>0</span></div>
<!-- PERCENT LOADER END-->
This section is for browser not support page when calls the function checkBrowser(). It shows error message when detect the browser does not support canvas.
<!-- BROWSER NOT SUPPORT START-->
<div id="notSupportHolder">
<div class="notSupport">YOUR BROWSER ISN'T SUPPORTED.<br/>PLEASE UPDATE YOUR BROWSER IN ORDER TO RUN THE GAME</div>
</div>
<!-- BROWSER NOT SUPPORT END-->
Device rotate instruction page when calls the function checkMobileOrientation(). It shows rotate instruction when device is in portrait view.
<!-- ROTATE INSTRUCTION START-->
<div id="rotateHolder">
<div class="mobileRotate">
<div class="rotateImg"><img src="assets/rotate.png" /></div>
<div class="rotateDesc">ROTATE YOUR DEVICE <br/>TO LANDSCAPE</div>
</div>
</div>
<!-- ROTATE INSTRUCTION END-->
Follow by one canvas tag in the body. The game start initiatie by calls the main function of the game initMain().
<!-- CANVAS START-->
<div id="canvasHolder">
<canvas id="gameCanvas" width="1280" height="768"></canvas>
</div>
<!-- CANVAS END-->
I'm using two CSS files in this game. The first one is a generic reset file. Many browser interpret the default behavior of html elements differently. By using a general reset CSS file, we can work round this. This file also contains some general styling, such as anchor tag colors, font-sizes, etc. Keep in mind, that these values might be overridden somewhere else in the file.
The second file contains all of the specific stylings for the page.
This game using Javascript files below.
Complete game flow:
The most important functions used for page.
The most important functions used for game.
The game contain 'design' folder which include following:
The folder 'assets' in 'game' folder contains all the images of the game that can be replaced. Is better to have the same size of the old ones if you want to reskin the game graphic without coding.
This game is build for Desktop browsers that support HTML5 canvas. Any mobile/tablet should work in landscape view, but they are not officially supported.
I've used the following font and sound files as listed.
Check out support policy here.
Ad Placeholder
Help simulate ads on HTML5 Games, you can integrate and display static and takeover ads through different
Ads Serving Platform.
> Documentation
Guide you through integrating Facebook Instant Games API in our HTML5 Games.
> Documentation
Once again, thank you so much for purchasing this game, if you have a more general question relating to the games on CodeCanyon, you might consider visiting the item page in the "Support" section.
If you like the game, please take a moment to rate it. Thanks! 




demonisblack