-
Notifications
You must be signed in to change notification settings - Fork 24
Config
This page explains all the commands and uses for the config.yml in the root directory of EntityJS games.
The config file lets you configure the interactions between the EntityJS gem and your game. This includes stuff like, script ordering, ignoring scripts, build settings and more. Currently the config file makes no changes to javascript code.
YML is a simple text structure often used for configuration of applications. Its just like JSON but very simple, here is an example both in JSON and YML.
canvas-id: game-canvas
width: 500
height: 300
order:
base.js
tile.js
entity-ignore:
util/*
scripts-ignore:
gun.js
items/*`
Is the same as this in JSON:
{
"canvas-id":"game-canvas",
"width":500,
"height":300,
"order":"base.js tile.js",
"entity-ignore":"util/*"
}
-
canvas-idDefines the canvas id and in the variablere.canvas. -
heightDefines the canvas height. -
widthDefines the canvas width.
-
scripts-ignoreWill ignore scripts with similar names. Regex accepted. -
entity-ignoreWill ignore entityjs scripts with similar names. Regex accepted. -
orderOrders files to be included before other scripts. Entityjs scripts are always included first. Regex accepted.
-
build-scripts-ignoreSame asscripts-ignorebut only runs duringentityjs buildcommand. This is useful if you're using plugins like JQuery and you don't want it to be included in the minified game.
Example: Ignore all scripts in the plugins folder
build-scripts-ignore: plugins/*
-
build-entity-ignoreSame asentity-ignorebut only runs duringentityjs buildcommand. This is useful if you don't want to compile all entityjs source with the game.
Example: Ignore all Entityjs scripts
build-entity-ignore: .*
-
build-headAppends whatever entered to the beginning of thegame.min.js -
build-footSame thing asbuild-headexcept to the end.
Example: Wrap game inside a self-executing anonymous function on build
build-head: (function(){
build-foot: })();
In the future all settings in the config.yml file will be available in JS and HTML precompiling. Similar to #define in C++.
For example defining base-attack: 1.1 will replace all text of RE_BASE_ATTACK with "1.1" inside HTML and JS files.
Currently only RE_CANVAS_ID, RE_HEIGHT, RE_WIDTH and RE_VERSION are available in some cases.