time.gametime - ICE 0.1 API documentation

ICE 0.1 API documentation

# time.gametime

Timing of game updates.

class GameTime;

  Handles timing of game updates.

  GameTime ensures that all game logic/physics/etc updates happen with a constant tick, and asynchronously relative to game renders, while renders can happen whenever time is available.
  For example, if renders are slow, one render might be followed by multiple game updates to cover time taken by the render. If they are fast, multple renders might happen between game updates.
  If game updates get too slow, they slow down while the game tick length is preserved, resulting in a gameplay slowdown.

  void doGameUpdates(bool delegate() updateDeleg);

    Run as many game updates as needed based on how much time has passed.

    Passed delegate should update any game subsystems or other state that needs to be updated in synchronization with game ticks.
    The delegate should return false normally, and true if the game updates must be interrupted (e.g. at the end of game).

    Parameters:

    bool delegate() updateDeleg | Delegate used to update game state.

  const pure nothrow @property real gameTime();

    Get current game time.

  const pure nothrow @property real timeStep();

    Get current time step (always constant, but kept non-static just in case).

  const pure nothrow @property real timeSpeed();

    Get time speed.

  pure nothrow @property void timeSpeed(const real rhs);

    Set time speed.

Copyright © Ferdinand Majerech 2011. | Page generated by AutoDDoc and Ddoc.