Time#Time

new Time(game)

This is the core internal game clock.

It manages the elapsed time and calculation of elapsed values, used for game object motion and tweens,
and also handles the standard Timer pool.

To create a general timed event, use the master Phaser.Timer accessible through events.

There are different types of time in Phaser:

  • Game time always runs at the speed of time in real life.

    Unlike wall-clock time, game time stops when Phaser is paused.

    Game time is used for timer events.

  • Physics time represents the amount of time given to physics calculations.

    When slowMotion is in effect physics time runs slower than game time.
    Like game time, physics time stops when Phaser is paused.

    Physics time is used for physics calculations and tweens.

  • Wall-clock time represents the duration between two events in real life time.

    This time is independent of Phaser and always progresses, regardless of if Phaser is paused.

Parameters
Name Type Description
game Phaser.Game

A reference to the currently running game.

Source code: time/Time.js (Line 38)
doc_phaser
2017-02-14 11:18:07
Comments
Leave a Comment

Please login to continue.