“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/pacmaker/
Open data/prefs.json with your favorite text editor.
Change parameters with the URL of your website at line 294:

	"MORE_GAMES_URL":{
		"value":"http://www.mydomain.com/",
		"type":"url",
		"properties":{
			"label":"More Games Link",
			"description":"Url for 'More Games' button",
			"group":"menu"
		}
	}

Now copy all files inside /pacmaker 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 meets the requests you have to change some more lines on configuration file.

Change the URL at line 304:

	"SCORE_URL":{
		"value":"http://www.mydomain.com/pacmaker/saveScore.php",
		"type":"url",
		"properties":{
			"label":"Leaderboard Server",
			"description":"URL to the server side script that will receive the score data.",
			"group":"sys"
		}
	}

If not aleady enabled, turn on the score button on the main menu screen by setting the parameter at line 264 to true
	"HISCORE_BUTTON":{
		"value":"true",
		"type":"bool",
		"properties":{
			"label":"Leaderboard Button",
			"description":"This turns on/off the Leaderboard Button from showing in home screen.",
			"group":"menu"
		}
	}

Enable the submit score button on the game over screen by setting the parameter at line 344 to true
	"SUBMIT_SCORE_BUTTON":{
		"value":"true",
		"type":"bool",
		"properties":{
			"label":"Submit Score Button",
			"description":"Enable or disable the Submit Score Button from showing in Game Over screen.",
			"group":"preferences"
		}
	}

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