“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/zombies/
Open js/config.js with your favorite text editor.
Change parameters with the URL of your website at line 48:

////////////////// More Games Button ////////////////
var MORE_GAMES_URL = "http://www.mydomain.com/"; // url of your website

Now copy all files inside /zombies 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

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 42:

//////////////////// Save Score ///////////////////// 
var SCORE_URL = "http://www.mydomain.com/zombies/saveScore.php"; //your url to the server side file that will receive the data.

Enable the score button on the main menu screen by setting the parameter at line 37 to true
var HISCORE_BUTTON = true; // true or false

Enable the submit score button on the game over screen by setting the parameter at line 57 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 /zombies/ 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




Go To Table of Contents