“Deploying the Game”


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

Now copy all files inside /triswipe folder inside your server using your favorite FTP client.
That's all, now you should be able to play the game from the URL.


Saving score on your server: Leaderboard

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.

If not already enabled, enable the score button on the main menu screen by setting the parameter at line 34 to true
var HISCORE_BUTTON = true; // true or false

If not already enabled, enable the submit score button on the game over screen by setting the parameter at line 49 to true
////////////////// Game Over screen ///////////////// 
var SUBMIT_SCORE_BUTTON = true; // true or false. Enable or disable the submit score button

Now copy all files inside /triswipe/ folder inside your server using your favorite ftp client.
With your FTP client select the score folder and give it the write permissions (typically 777).

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


Sharing score on social networks: Facebook - Twitter - Google Plus

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



Go To Table of Contents