new SynchronizedClock()
A synchronized clock can keep the same time generation as,
for example, a remote server.
- Source:
Extends
Members
-
<private> deltaSync :number
-
Time diference between clocks.
Type:
- number
- Source:
Methods
-
getFps() → {number}
-
Gets the current fps count.
- Inherited From:
- Source:
Returns:
Fps count.- Type
- number
-
getTime()
-
- Source:
-
<private> reset(time)
-
Resets all properties, at least at each second passed.
Parameters:
Name Type Description time
number Current time. - Inherited From:
- Source:
-
sync(syncTime)
-
Synchronizes this clock with a remote clock, based on the time difference.
Parameters:
Name Type Description syncTime
number Time difference between clocks. - Source:
-
update() → {number}
-
Updates the game. Should be at the beggining of the frame.
- Inherited From:
- Source:
Returns:
Time, in miliseconds, elapsed since the last update.- Type
- number