Namespace: game

me. game

me.game represents your current game, it contains all the objects, tilemap layers, current viewport, collision map, etc...
me.game is also responsible for updating (each frame) the object status and draw them
Source:
game.js, line 9

Members

<static> HASH :Object

Provide an object hash with all tag parameters specified in the url.
Type:
Properties:
Name Type Argument Default Description
hitbox Boolean <optional>
false draw the hitbox in the debug panel (if enabled)
velocity Boolean <optional>
false draw the entities velocity in the debug panel (if enabled)
quadtree Boolean <optional>
false draw the quadtree in the debug panel (if enabled)
webgl Boolean <optional>
false force the renderer to WebGL
Source:
game.js, line 113
Example
// http://www.example.com/index.html#debug&hitbox=true&mytag=value
console.log(me.game.HASH["mytag"]); //> "value"

<static> mergeGroup :boolean

when true, all objects will be added under the root world container
when false, a `me.Container` object will be created for each corresponding `TMXObjectGroup` default value : true
Type:
  • boolean
Source:
game.js, line 76

<static> sortOn :string

The property of should be used when sorting entities
value : "x", "y", "z" (default: "z")
Type:
  • string
Source:
game.js, line 88

<static> viewport :me.Viewport

a reference to the game viewport.
Type:
Source:
game.js, line 57

<static> world :me.Container

a reference to the game world
a world is a virtual environment containing all the game objects
Type:
Source:
game.js, line 66

Methods

<static> getParentContainer(child) → {me.Container}

Returns the parent container of the specified Child in the game world
Parameters:
Name Type Description
child me.Renderable
Source:
game.js, line 228
Returns:
Type
me.Container

<static> onLevelLoaded()

Fired when a level is fully loaded and
and all entities instantiated.
Additionnaly the level id will also be passed to the called function.
Source:
game.js, line 98
Example
// call myFunction () everytime a level is loaded
me.game.onLevelLoaded = this.myFunction.bind(this);

<static> repaint()

force the redraw (not update) of all objects
Source:
game.js, line 240

<static> reset()

reset the game Object manager
destroy all current objects
Source:
game.js, line 173

<static> updateFrameRate()

Update the renderer framerate using the system config variables.
Source:
game.js, line 204
See:
Copyright © 2011 - 2017, Olivier Biot, Jason Oster, Aaron McLeod
Documentation generated by JSDoc 3.4.0 on 2017-02-28T11:37:40+08:00 using the DocStrap template modified by codename-.