Created: 05/09/2016
By: Code This Lab S.r.l.
Email: info@codethislab.com
Thank you for purchasing our game. If you have any questions that are beyond the scope of this help file, please feel free to email via user page contact form here. Thanks so much!
Craps is a HTML5 casino game. Try your luck with this stylish 3D version of Craps Casino Game!
The game contains all the main craps game features like hardways and horn bets.
The ZIP package contains the game with 1280x768 resolution that scales to fit the whole screen device
Just warning that for very wide screens, the game may not be perfectly full screen.
The game is fully compatible with all most common mobile devices.
Sounds are enabled for mobile but we can't grant full audio compatibility on all mobile devices due to some well-know issue between some mobile-browser and HTML5.
So if you want to avoid sound loading, please read Enable Sound section).
WARNING: Sounds can't be enabled for Windows Phone as this kind of device have unsolved issues with 'audio' and 'video' tag.
The item package contains the following folders:
To install the game just upload on your server the game folder live_demo. WARNING: The game won't run LOCALLY with some browser like Chrome due to some security restrictions. To let it work correctly you have to upload it online.
$(document).ready(function(){ var oMain = new CMain(); $(oMain).on("save_score", function(evt,iMoney) { //alert("iMoney: "+iMoney ); }); });
var TEXT_MONEY = "MONEY"; var TEXT_CUR_BET = "CUR BET"; var TEXT_MIN_BET = "MIN BET"; var TEXT_MAX_BET = "MAX BET"; var TEXT_ROLL = "ROLL"; var TEXT_EXIT = "EXIT"; var TEXT_RECHARGE = "RECHARGE"; var TEXT_YOU_WIN = "GREAT!! YOU WIN"; var TEXT_CURRENCY = "$"; var TEXT_ARE_SURE = "ARE YOU SURE?"; var TEXT_COME_OUT = "COME OUT"; var TEXT_ERROR_NO_MONEY_MSG="NOT ENOUGH MONEY FOR THIS BET!!"; var TEXT_ERROR_MAX_BET_REACHED="MAX BET REACHED!!"; var TEXT_ERROR_MIN_BET = "YOU BET IS LOWER THAN MINIMUM BET!!"; var TEXT_NO_MONEY = "YOU DON'T HAVE ENOUGH MONEY!!!"; var TEXT_RECHARGE_MSG = "PLEASE CLICK RECHARGE BUTTON TO PLAY AGAIN"; var TEXT_WAITING_BET = "WAITING FOR YOUR BET..."; var TEXT_READY_TO_ROLL = "ROLL WHEN YOU'RE READY!"; var TEXT_HELP_MSG = new Array(); TEXT_HELP_MSG["pass_line"] = "PLACE YOUR BET ON PASS LINE"; TEXT_HELP_MSG["dont_pass1"] = "PLACE YOUR BET ON DON'T PASS"; TEXT_HELP_MSG["dont_pass2"] = "PLACE YOUR BET ON DON'T PASS"; TEXT_HELP_MSG["dont_come"] = "PLACE YOUR BET ON DON'T COME"; TEXT_HELP_MSG["come"] = "PLACE YOUR BET ON COME"; TEXT_HELP_MSG["field"] = "PLACE YOUR BET ON FIELD"; TEXT_HELP_MSG["big_6"] = "PLACE YOUR BET ON BIG 6"; TEXT_HELP_MSG["big_8"] = "PLACE YOUR BET ON BIG 8"; var aValues = [4,5,6,8,9,10]; var aInfosLay = ["1:2 ON 7 BEFORE POINT LESS 5% OF WIN", "2:3 ON 7 BEFORE POINT LESS 5% OF WIN", "5:6 ON 7 BEFORE POINT LESS 5% OF WIN", "5:6 ON 7 BEFORE POINT LESS 5% OF WIN", "2:3 ON 7 BEFORE POINT LESS 5% OF WIN", "1:2 ON 7 BEFORE POINT LESS 5% OF WIN"]; var aInfosLose = ["5:11 ON 7 BEFORE POINT", "5:8 ON 7 BEFORE POINT", "4:5 ON 7 BEFORE POINT", "4:5 ON 7 BEFORE POINT", "5:8 ON 7 BEFORE POINT", "5:11 ON 7 BEFORE POINT"]; var aInfosBuy = ["2:1 ON MAKING POINT LESS 5% OF BET", "3:2 ON MAKING POINT LESS 5% OF BET", "6:5 ON MAKING POINT LESS 5% OF BET", "6:5 ON MAKING POINT LESS 5% OF BET", "3:2 ON MAKING POINT LESS 5% OF BET", "2:1 ON MAKING POINT LESS 5% OF BET"]; var aInfosWin = ["9:5 ON MAKING POINT", "7:5 ON MAKING POINT", "7:6 ON MAKING POINT", "7:6 ON MAKING POINT", "7:5 ON MAKING POINT", "9:5 ON MAKING POINT"]; for(var i=0;iGame option: You can easily customize game setting when creating a new instance of the game in index.html file var oMain = new CMain({ money: 1000, //STARING CREDIT FOR THE USER min_bet: 1, //MINIMUM BET max_bet: 100, //MAXIMUM BET win_occurrence: 30,//Win occurrence percentage (100 = always win). time_show_dice_result: 3000, //TIME IN MILLISECONDS OF DICE RESULT SHOWING. casino_cash:400, //The starting casino cash that is recharged by the money lost by the user show_credits:true, //SET THIS VALUE TO FALSE IF YOU DON'T WANT TO SHOW CREDITS BUTTON audio_enable_on_startup:false, //ENABLE/DISABLE AUDIO WHEN GAME STARTS fullscreen:true, //SET THIS TO FALSE IF YOU DON'T WANT TO SHOW FULLSCREEN BUTTON check_orientation:true, //SET TO FALSE IF YOU DON'T WANT TO SHOW ORIENTATION ALERT ON MOBILE DEVICES num_hand_before_ads:10 //NUMBER OF DICE ROLLING TO COMPLETE, BEFORE TRIGGERING SAVE_SCORE EVENT. USEFUL FOR INTER-LEVEL AD EVENTUALLY. // //// THIS FUNCTIONALITY IS ACTIVATED ONLY WITH CTL ARCADE PLUGIN./////////////////////////// /////////////////// YOU CAN GET IT AT: ///////////////////////////////////////////////////////// // http://codecanyon.net/item/ctl-arcade-wordpress-plugin/13856421 /////////// });
D) Set Win Occurrence - top
You can set the win occurrence percentage, editing the parameter 'win_occurrence' in index.html. Set a value between 0 and 100.
The win occurrence is strictly related to the 'casino_cash' parameter, that is the amount of money that the casino table currently have. So if the casino money are less than the current player bet, the player can't win because the game doesn't have enough money.
E) HTML Structure - top
This game have the canvas tag in the body. The ready event into the body calls the main function of the game: CMain().
The head section declares all the javascript functions of the game. The whole project uses a typical object-oriented approach.
In the init function there are 6 mapped events that can be useful eventually for stats
F) CSS Files and Structure - top
The game use two CSS files. 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. 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 canvas and some hack to be fully compatible with all most popular mobile devices
G) JavaScript - top
This game contains:
- jQuery
- Our custom scripts
- CreateJs plugin
- Howler Sound library
- jQuery is a Javascript library that greatly reduces the amount of code that you must write.
- The game have the following js files:
- CMain: the main class called by the index file.
This file controls the sprite_lib.js file that manages the sprite loading, the loop game and initialize the canvas with the CreateJs library- ctl_utils: this file manages the canvas resize and its centering
- sprite_lib: this class loads all images declared in the main class
- settings: general game settings
- CLang: global string variables for language localization
- CPreloader: simple text preloader to show resources loading progress
- CMenu: simple menu with play button
- CGfxButton: this class create a standard button
- CTextButton: this class create a standard text button
- CGame: this class manages the game logic
- CInterface: this class controls game GUI that contains text and buttons
- CGameOver: this class controls the game over panel that appears when player lose all the lives
- CBetTableButton: this class manages the table hit area
- CEnlight: this class manages the sprites that enlight bets on table
- CFiche: this class manages the fiche sprite
- CFicheBut: the buttons on table to select the fiche
- CFichesController: this class manages the fiches on table
- CMsgBox: this class manages the message box that appear for warning
- CGameSettings: this class contains all the info about dice rolling frames, fiche values, etc..
- CSeat: this class manages some user info like money, current bet, etc...
- CTableController: this class manages all table bet button
- CTweenController: this class manages the fiches tweening
- CDicesAnim: this class manages the 3D dice rolling animation
- CAreYouSurePanel: this class manages the panel that pop up when user click on exit button.
- CCreditsPanel: this class manages the credits panel into menu screen
- CDicesTopDownView: this class manages small panel that shows the dice result in a windon on the top-right corner
- CPuck: this class manages the puck that is used to assign eventually a number after dice rolling.
- CreateJs is a suite of modular libraries and tools which work together to enable rich interactive content on open web technologies via HTML5.
- Howler is a javascript Audio library.
Resuming, the complete game flow is the following:
- The index.html file calls the CMain.js file after ready event is called
- The main class calls CPreloader.js to init preloader text and start sprite loading
- When all sprites contained in "/sprites" folder are loaded, the main class removes the preloader and calls the CMenu.js file that shows the main menu
- If user click on the play button in main menu, the CGame.js class is called and the game starts
- The User can start the game, clicking one of the chips on table
- If user click on the exit button in the up-right corner, the game returns to the menu screen
H) Game functions - top
In this section will be explained all the most important functions used in CGame.js file.
- _init()
This function attach on the canvas some game sprites like background (oBg), GUI and initialize Table Controller, Fiche Controller and other panels.- unload()
This function removes all images from canvas and event listeners on buttons. It's called when user decide to exit from the game.- _generateWinLoss()
This function choose randomically if the user should win or lose after dice rolling.- dicesAnimEnded()
This function is called when dice rolling is executed.- onRoll()
This function is called when user click roll button.- _onShowBetOnTable()
This function shows the chips on the table.- update()
This function manages the main game loop.I) Hide Credits - top
If you want to hide credits in main menu, change to false the following value in index.html file:
show_credits:false
J) Change Graphic - top
You can easily change all the game graphic, replacing all the file you need in the "/sprites" folder. Just respect file format (.png or .jpg) and size if you don't want to change any code line.
K) Disable Sounds - top
If you want to disable all the sounds for mobile devices, you have to change the following value in settings.js file:
var DISABLE_SOUND_MOBILE = true;
I) Wordpress Plugin - top
CTL Arcade will allow you to add a real arcade on your worpress website, in this way your users will be more involved and will stay connected longer.
It's possible to add Ads banner at the beginning of each game and at the end of each level. This will give you a new tool to increase your revenues.
Your own users will promote your website sharing their scores on the main Social Networks, with no extra costs for you.
You'll get by default the score-sharing on Twitter. To add Facebook just follow the guideline below.
3 widgets can be added in your pages through a shortcode.
Minimum Requirements:
- Game iframe
- Rate the Game
- Leaderboard
This plugin is designed to work only with games built by Code This Lab.
- PHP 4.3
- WordPress 4.3.1
- HTML5
- Canvas
- Javascript / jQuery
You can find it here!![]()
Once again, thank you so much for purchasing this game. Fell free to contact us if you have any questions or issue relating to this game. No guarantees, but we'll do our best to assist.