b10gph (Grand Prix Champ) - V1.2.XXX (RC)
------------------------------------------------------------------------
Produced by b10b games (a Hypersurge Interactive brand) for Mobile Games Hub
FILES
-----
This folder contains (* denotes examples only, no need to deploy further):
"assets/*" - graphics, audio, font binary assets loaded by the game
"_readme.txt" * - this file
"manifest.appcache" * - a list of all files used in this game - by default the manifest is disabled (to enable it set manifest="manifest.appcache" in index.html's tag and ensure server is configured with correct mime type)
"createjs.min.js" - js library for display methods used by game.js (minified), CreateJS is a popular JS library and may be found on trusted CDNs
"game.js" - js file for the game (minified)
"assets/__Config.xml" - xml file containing in game text and configuration details - see below on how to load this at runtime
"index.html" - html file containg the game canvas and style sheet
All xml should be saved as unicode format (utf-8) for advanced ascii characters.
VERSION & ISSUE TRACKING
------------------------
To find the accurate version number (and corresponding repository revision) run the game and view the Developer Console in your desktop browser (usually F12). The version will be visible at the top.
CONFIGURATION
-------------
By default the game has all configuration baked into its code.
This default configuration can be overridden at runtime by loading settings from a relative, same domain, file (e.g. "assets/__Config.xml" ).
To do so add a html attribute to index.html's "gameCanvas" element:
config="assets/__Config.xml"
If the page is loaded with an additional "?lang=%languageCode%" parameter the game will ignore the attribute and attempt to load Config from the path: "assets/__Config_%languageCode%.xml".
For example, "index.html?lang=fr" will load "assets/__Config_fr.xml". This allows multiple, language specific, config files to be loaded at runtime on demand. Add more languages as required.
Due to security restrictions in most browsers local file loading (and crossdomain loading) is disabled. Therefore custom configs will only work when the files are loaded from a webserver (i.e. http:// or https://). For a lightweight local webserver search for "Mongoose webserver".
It is possible to chain multiple config files sequentially using the "settings.joinXml" node. Each subsequent file will override existing nodes.
FullScreen mode is enabled by default for mobile devices, and disabled by default on desktop devices. It attempts to resize the game canvas to 100%. To override this add an XML node settings.fullScreen or add an html attribute to the gameCanvas. Options are all, default, mobile, desktop.
fullScreen="all"
FullScreen buttons are shown on the pause menu by default. To disable them add the following attribute:
fullScreenButton="false"
NativeExperience mode is enabled by default for mobile devices. It attempts to force the game into the JS FullScreen API, and lock orientation of the device (browser and device permitting). To override this add an XML node settings.nativeExperience or add an html attribute to the gameCanvas. Options are true, false.
nativeExperience="true"
The JS FullScreen API will likely fail if using iframe(s) to embed the game into a website. To fix this add the following attributes to all parent iframes:
allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true"
TEXT FORMATTING
---------------
All text in the "__Config.xml" (and subsequent xml files) can be modified to suit your requirements. The following characters are embedded as standard in the webfonts:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1234567890
\!"$%&*()-+=;:@'#,.?/
™®ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜßàáâãäåæçèéêëìíîïñòóôõöùúûüŒœøØåÅ¿
For extended character ranges, new webfonts should be included via CSS and assigned by name in node "settings.font.name". Please contact Hypersurge for creation of such files.
Please note each node's approximate length, and try and match - check thoroughly in game once changes have been made.
CDATA nodes can be used to fully embrace a node's value - e.g.
Basic HTML tags can be used to extend the formatting of each text field. E.g. for italics wrap a node's value with italicised (it is sometimes recommended to add an extra space before italicised text for clarity). Use CDATA or escape the HTML - e.g.:
Normal text <i>italic text</i>
SPECIFIC NODES
--------------
The following nodes are required configuration settings (rather than text display). They have the following names, purposes and ranges:
"settings.joinXml" - chain xml files together (optional): will load xml file named in node after this current file is completed (keep on same domain)
"settings.font.name" - the name of the font used in the game (must be a valid webfont and loaded from CSS)
"settings.urls.website" - the url for all client website links
"settings.googleAnalytics" - set this node's id attribute to a valid Google Analytics ID if tracking is required, and set enabled attribute to true
"settings.audioHoldDelay" - how long an iOS device will wait for a touch event to initialise the audio system after preloader is completed (integer in ms)
"settings.disableEyeCandy" - whether to disable performance-heavy, non-critical in-game visual effects (boolean, default false)
"settings.disableDeviceMotion" - whether to disable device motion events to control the game (boolean, default false) - if setting this to true, you may need to update instructions text and / or graphics
"settings.orientationApproximation" - (boolean, default false) set this to true to favour innerWidth > innerHeight logic over use of screen.orientation
"settings.startingLevel" - the default starting race displayed on SelectLevel scene (integer 0...3, default 0)
TESTING
-------
Enable TestMode from the Level Select scene by holding keys "[" & "]" down while clicking the "Start race" button. Test mode unlocks the following features:
1) Finish button - ends the race as if the car had crossed the finish line
2) Skip button - progresses to the next scene without completing the race
GOOGLE ANALYTICS EVENTS
-----------------------
Google Analytics is only active if there is a valid GA tracker ID in "settings.googleAnalytics" XML node and "enabled" is "true".
Please ensure that Google Analytics Tracker code is also embedded in the html page.
"scene" - for each new scene (postfixed with scene type)
"button" - for each button press (postfixed with button type and scene type)
"play" - game is played first time (postfixed with location type)
"replay" - game is played again (postfixed with location type)
"rank" - how well player performed ["good": 1,2,3, "ok": 4,5,6,7,8,9, "poor": 10,11,12] (postfixed with location type)
"url" - the CTA to website was called