game

PP. game

The namespace containing the main functions of the game engine.
Source:

Methods

(static) create(config)

Create the game object and initialize the Phaser framework. This function must be called before PP.game.start is executed.
Source:
Parameters:
Name Type Description
config The object containing the game configuration.
Name Type Description
canvas_width number The width of the canvas where the game will be rendered.
canvas_height number The height of the canvas where the game will be rendered.
canvas_id string The id of the HTML element containing the canvas.
background_color number Default background color used when no background is drawn, in RGB HEX format (for example 0x000000).
debug_mode boolean It defines whether PoliPhaser should run in debug mode showing various debug information.
gravity_value number The value of gravity in pixels per second squared.
Returns:
A game object. The user should not directly manipulate it, but pass it to other functions.

(static) get_physics_fps(scene)

Get the fixed value for the physics FPS. Note: this is only the FPS of the physics engine, not the rendering engine!
Source:
Parameters:
Name Type Description
scene object The scene object

(static) set_physics_fps(scene, fps)

Enforce a fixed value for the physics FPS. Note: this is only the FPS of the physics engine, not the rendering engine!
Source:
Parameters:
Name Type Description
scene object The scene object
fps number The FPS to set

(static) time_delta()

Return the delta time between the current frame and the previous one of the rendering engine. This value may be averaged with a moving window.
Source:

(static) time_frame_nr()

Return the number of the current frame starting from 0.
Source:

PP. game

The namespace containing the state variables of the game.
Source:

Methods

(static) create(config)

Create the game object and initialize the Phaser framework. This function must be called before PP.game.start is executed.
Source:
Parameters:
Name Type Description
config The object containing the game configuration.
Name Type Description
canvas_width number The width of the canvas where the game will be rendered.
canvas_height number The height of the canvas where the game will be rendered.
canvas_id string The id of the HTML element containing the canvas.
background_color number Default background color used when no background is drawn, in RGB HEX format (for example 0x000000).
debug_mode boolean It defines whether PoliPhaser should run in debug mode showing various debug information.
gravity_value number The value of gravity in pixels per second squared.
Returns:
A game object. The user should not directly manipulate it, but pass it to other functions.

(static) get_physics_fps(scene)

Get the fixed value for the physics FPS. Note: this is only the FPS of the physics engine, not the rendering engine!
Source:
Parameters:
Name Type Description
scene object The scene object

(static) set_physics_fps(scene, fps)

Enforce a fixed value for the physics FPS. Note: this is only the FPS of the physics engine, not the rendering engine!
Source:
Parameters:
Name Type Description
scene object The scene object
fps number The FPS to set

(static) time_delta()

Return the delta time between the current frame and the previous one of the rendering engine. This value may be averaged with a moving window.
Source:

(static) time_frame_nr()

Return the number of the current frame starting from 0.
Source: