In order to deploy the game in your website you have to do some minimal changes to configuration file before uplaoding files.
Let's suppose you wish to deploy the game on www.mydomain.com/triswipe/
Open js/config.js with your favorite text editor.
Change parameters with the URL of your website at line 46:
////////////////// More Games Button //////////////// var MORE_GAMES_URL = "http://www.mydomain.com/"; // url of your website
If you wish to enable the saving of the score on your server, you need a Linux server supporting PHP, that is the most common kind of hosting servers you find on the Internet.
If you server meet the requests you have to change some more lines on configuration file.
Change the URL at line 39:
//////////////////// Save Score ///////////////////// var SCORE_URL = "http://www.mydomain.com/triswipe/saveScore.php"; //your url to the server side file that will receive the data.
var HISCORE_BUTTON = true; // true or false
////////////////// Game Over screen ///////////////// var SUBMIT_SCORE_BUTTON = true; // true or false. Enable or disable the submit score button
That's all, now you should be able to play the game from the URL and saving the score.
By default scores are reset each day, if you wish to change this behavior open the file saveScore.php and scroll down to line 42 that is:
$hiscore=@file("scores/".$year.$month.$mday);you can modify this way:
$hiscore=@file("scores/".$year.$month);and you get the score resetting every month.
$hiscore=@file("scores/".$year);you will get the score reset every year
If you wish to enable the sharing of the score on social networks, as for the leaderboard, you need a Linux server supporting PHP.
If you server meet the requests you have to change some more lines on configuration file.
Change the URL at line 13 with the URL where you deploy your game:
var GAME_URL = "http://www.mydomain.com/triswipe/";If not already enabled, enable the Share score button on the game over screen by setting the parameter at line 50 to true
var SHARE_SCORE_BUTTONS = true; // true or false. Enable or disable social share of the score