advanceTimefunction
Adds explicit host-measured elapsed time. Arcade runs end at 180 seconds; no clock is read here.
Import it
import { advanceTime } from "@johnmorrisdotca/houseki/gem-swap";
Definition
function advanceTime(state: GameState, milliseconds: number): Transition
Parameters
| Name | Type | Description |
|---|---|---|
state | GameState | The immutable native state to read or transition; the input is retained. |
milliseconds | number | The nonnegative elapsed milliseconds for the native timer. |
Returns
Transition
Adds explicit host-measured elapsed time. Arcade runs end at 180 seconds; no clock is read here.
Examples
import { advanceTime, createGame } from "@johnmorrisdotca/houseki/gem-swap";
const state=createGame({seed:"docs"});
console.log(advanceTime(state,16).state.phase);readyWhat it prints (run when this page was built)