“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. 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 MOBILE_ADS = true;
var DESKTOP_ADS  = true;
Those options turn on/off the in game ads for mobile and desktop.
Set you ads scripts by editing the index.html file. Search for the lines
<!-- low resolution mobile ads -->
<div id="ads_low_mobile">
Here mobile ads script for low resolution</script>
</div>
<!-- low resolution desktop ads -->
<div id="ads_low_desktop"><div style="height:50%; margin-top:25%">
Here desktop ads script for low resolution
</div></div>
<!-- hi resolution mobile ads -->
<div id="ads_hi_mobile">
Here mobile ads script for hi resolution
</div>
<!-- hi resolution desktop ads -->
<div id="ads_hi_desktop"><div style="height:50%; margin-top:25%">
Here desktop ads script for hi resolution
</div></div>

and edit them by adding ads scripts from your ads provider. Provider for desktop ads and mobile ads may be not the same.

var INTERSTITIAL_ADS = true;
When this option is true the ads is shown as interstitial and a button for dismiss them is put in the upper left corner of the screen, otherwise, ads are intended as banner and are shown on screen between levels, under the user interface buttons.


var GAME_URL = "http://triswipe.ffx.it/";
This parameter tell the game where it is deployed, it is used for sending data to the social sharing script.




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 = "#0000FF";
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 = "triSwipe";
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 = "#f200ff";
Color for second line expressed in hex value.


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


var LOADING_BAR_COLOR = "#f200ff";
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 = true;
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/triswipe/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/triswipe/id#########";
var ANDROID_RATING_URL = "market://details?id=it.ffx.triswipe";

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.

var SHARE_SCORE_BUTTONS = true;
Enable or disable the share score to social networks buttons 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 BLOCKS_SPEED = 30;
It's the blocks move delay between frames expressed in milliseconds.
1 = very fast blocks
1000 = very slow blocks.


var DELAY = 9000;
Default delay for adding a new line expressed in milliseconds: 9000 milliseconds = 9 seconds.


var MIN_DELAY = 6000;
Minimum delay for adding a new line expressed in milliseconds: 6000 milliseconds = 6 seconds.


var DELAY_DECREMENT = 100;
DELAY decrements by this value down to MIN_DELAY. Value is expressed in milliseconds: 100 milliseconds = 1/10 second.


var LINE_SCORE = 100;
Set how many points for each line removed.


var FREE_LINE_SCORE = 10;
Set how many points for each free line at the end on each level.


var CONSTRAINED = false;
Set the constrained starting point on/off.


var ALLOW_STRAIGHT_LINE = false;
Allow or not the drawing the four aligned blocks shape.


var SHOW_HELPER = true;
Show or hide the helper showing where the drown piece will fits.


var TARGET_START = 6;
This is the target number of lines to complete in order to finishing the first level.


var TARGET_INCREMENT = 4;
This is the number that will be added each level to the target for finishing level.


var START_WALL_HEIGHT = 2;
This is the height on blocks wall on the first level.


var WALL_INCREMENT = 0.5;
This number will be added to the wall height on each level, a value of 0.5 means the wall will be one line bigger every two levels.


var MAX_WALL_HEIGHT = 6;
This is the maximum lines height the blocks blocks wall will reaches.



E) files - top

Background Images File List

var BACKGROUND_IMAGES =[
	"back_1.jpg",
	"back_2.jpg",
	"back_3.jpg",
	"back_4.jpg",
	"back_5.jpg"
	];
The value of this parameter is the list of the graphic files used as game background. When the sequence is over then the sequence starts again from the first one.
Backgrounds graphic files are located in folders data/img/background_hires/ (hi resolution versions) and in data/img/background_lowres/ (low resolution versions). You can ad as many backgrounds you wish..





Go To Table of Contents