“The Configuration File”


js/config.js is the configuration file. By editing config file you can change many aspect of the gameplay.

You can edit it by using your favorite text editor software like Gedit, Notepad++, Komodo or many others.

  1. General configurations
  2. Graphical User Interface
  3. Game settings
  4. Animations
  5. Files

A) General configurations - top

var SCALE_INTERPOLATION_DESKTOP	= true;
var SCALE_INTERPOLATION_MOBILE	= true;
The game viewport is scaled to fit the dimension of the browser window, or screen device, in order to show the game at the best size.
Scaling operation can be performed interpolating pixels for better and smoothest graphic quality.
Interpolation is performed at the price of a little extra CPU time. Even on older computers this is not a big trouble, but, if you target low end mobile devices you have the option of switch off this feature.
The two parameters refers to interpolation when the game runs on desktop/laptop or on mobile.


var MAX_FPS = 30;
You can set the maximum frame per second value to be performed by the game.
If you target desktop users, 60 fps is a good value for having the smoothest movements.
If you target mobile devices, 30 or 40 fps is a good compromise between smoothness and performances.
If you target low end devices you should try 15 or so.


var AUDIOENABLED = true;
This option turns on/off the audio of the game. If you turn it off but you set visible the audio toggle button, the user can turn back it on by using such button, so, you can think about this option as a sort of default state of the audio toggle button.


var MUSICENABLED = true;
This option enable the in-game background music. If you turn it off there is no way to turn it on by the user.


var ADS_ON_NEW_LEVEL = true;
This option turns on/off the ad screen when player completes each level.


var ADS_ON_DEATH = true;
This option turns on/off ad screen when player dies.


var BETWEEN_LEVELS_ADS_DESKTOP = "ad.html";
This field contains the URL of the page shown, when games runs on a pc, if ADS_ON_NEW_LEVEL and/or ADS_ON_DEATH are set to true.


var BETWEEN_LEVELS_ADS_MOBILE	= "ad.html";
This field contains the URL of the page shown, when games runs on a mobile device, if ADS_ON_NEW_LEVEL and/or ADS_ON_DEATH are set to true.
For example Leadbolt offers a App Wall that fits nicely here.


var IN_GAME_ADS = true;
This option turns on/off the in game banner.
Set you ad banner by editing the index.html file. Search for the line
<div id="ads" style="bottom:0; background-color:#000">HERE YOUR ADS CODE</div>	

and put your banner code instead of the sentence HERE YOUR ADS CODE.
You can put banner at the top of the screen with top:0; code or at the bottom with bottom:0;code.
If you decide of activating the in game banner you should leave enough space for it when you design levels.



B) Graphical User Interface - top

var GAME_LANGUAGES = ["en","it"];
This parameter consists in the list of languages the game can use for showing texts.
The game comes with English and Italian languages, so, if user's browser is set to Italian, texts are shown in Italian, for any other language configuration forces the engine to fall back on English.
Game comes with the value set to ["en","it"], if you wish to add a new language you need to add the language code to the list. For example, if you wish to add Spanish, the parameter value will become ["en","it","es"].
Then you need to make a copy of the English language file, rename it, according to the language you added and translate it.
Languages files are located in data/local/ folder, so, make a copy of data/local/en.json and rename the copy as data/local/es.json.


Loading Screen Options

var GAME_NAME_1 = "Loading...";
Game name first line.


var GAME_NAME_1_SIZE = 30;
Font size for first line, you can change this value according to the length of the name in order to get the best pagination.


var GAME_NAME_1_COLOR = "#FF7700";
Color for first line expressed in hex value. You can get hex colors by using photo editing software or paint applications like Gimp, Photoshop, Krita, Mypaint, etc.


var GAME_NAME_2 = "Joe Volcano";
Game name second line.


var GAME_NAME_2_SIZE = 50;
Font size for second line, you can change this value according to the length of the your text in order to get the best pagination.


var GAME_NAME_2_COLOR = "#FFFF00";
Color for second line expressed in hex value.


var LOADING_BG_COLOR = "#660000";
Background color of the loading screen expressed in hex value.


var LOADING_BAR_COLOR = "#FFFF00";
Color of the progress bar expressed in hex value.


Main menu screen

There are a series of buttons in the main menu screen that you can decide if they will be visible or not.


var TOGGLE_AUDIO_BUTTON = true;
Value may be true or false for enabling or disabling the button. The toggle audio button allows user to switch audio on or off.


var FULLSCREEN_BUTTON = true;
Value may be true or false for enabling or disabling the button. On desktop/laptop computers this button will scale the game at the maximum screen size, maintaining the game viewport aspect ratio. On mobile devices this button will be automatically hidden.


var INFORMATION_BUTTON = true;
Value may be true or false for enabling or disabling the button. This button opens an info screen where you can write information for the user. For example if you use graphic, sound, music made by other people, sometimes, is required you credit the author for his work, this page may be the right place for do so.


var HISCORE_BUTTON = true;
Value may be true or false for enabling or disabling the button. This button shows the hi-score screen stored on your server. If you plan to not use that feature, remove this button.


var HOW_TO_PLAY_BUTTON = false;
Value may be true or false for enabling or disabling the button. This button opens the how to play screen where the user gets instruction on how to play the game.


var MORE_GAMES_BUTTON = true;
Value may be true or false for enabling or disabling the button. This button is a nice way of driving back traffic on your website for playing other games.


Save Score

var SCORE_URL = "http://www.ffx.it/games/joe-volcano/saveScore.php";
Absolute URL to the script receiving score data. The script is saveScore.php and is located in the root folder where you placed the game on the server.
Remember to give write permissions (typically 777) to the folder scores/ on server.


App Stores

var IOS_RATING_URL		= "https://itunes.apple.com/us/app/joevolcano/id#######";
var ANDROID_RATING_URL	= "market://details?id=it.ffx.joevolcano";

The game is ready for be packaged as App using cocoonJs wrapper. If you do so, use this parameters for invite your user to rating your game on the Apple App Store and on Google Play.


More Games Button

var MORE_GAMES_URL = "http://ffx.it/";
Url to your website used by the 'more game' button.


Game Over Screen

var SUBMIT_SCORE_BUTTON = true;
Enable or disable the send score to the server button that you find in the game over screen.


Input Name Screen

var KEYBOARD_NUMBERS = false;
Enable or disable number keys in virtual keyboard



C) Game settings - top

var START_VELOCITY = 120;
This is the initial velocity when game starts, expressed in pixel per seconds.


var MAX_VELOCITY = 240;
This is the maximum velocity the game can reach when advancing levels. It is expressed in pixel per seconds.


var VELOCITY_INCREMENT = 30;
This is the velocity increase amount from one level to another, expressed in pixel per seconds.
Velocity increases of this value up to the MAX_VELOCITY value.



E) files - top

Levels Files List

var LEVELS_FILES =[
	"level0.json",
	"level1.json",
	"level2.json",
	"level3.json",
	"level4.json"
	];
The value of this parameter is the list of the level files. When all the levels are completed then the sequence starts again from the first but the levels counter will continue increasing during the game. For example, if you sets a total of 4 levels, when the player compete the fourth level, it will be loaded the level one as the following level but it will be shown as level five.
You can design your own levels by loading one of the provided tmx file, extending it and saving it with a new name by using Tiled, a free and open source software. Tiled is a general purpose tile map editor. It allow the creation of map layouts and specifying things such as collision areas, enemy spawn positions or power-up positions. It saves all of this data in a convenient, standardized tmx format and allow you the export of the data in json file format.
You can run Tiled on Windows, OSX or Linux. Get a copy of Tiled for your OS from here.





Go To Table of Contents