Reference · Shizen and Arashi environments
applyEarthquakefunction
Commit one bounded environmental resolution; matching, gravity and score remain the host game's job.
Import it
import { applyEarthquake } from "@johnmorrisdotca/houseki/nature";
Definition
function applyEarthquake(state: NatureState, options: EarthquakeOptions): EnvironmentTransition
Parameters
| Name | Type | Description |
|---|---|---|
state | NatureState | The immutable native state to read or transition; the input is retained. |
options | EarthquakeOptions | Validated native creation, authored challenge, or environment options described by this signature. |
Returns
EnvironmentTransition
Commit one bounded environmental resolution; matching, gravity and score remain the host game's job.
Examples
import { applyEarthquake, createNatureState } from "@johnmorrisdotca/houseki/nature";
const state=createNatureState({width:4,height:4,seed:"docs"});
console.log(applyEarthquake(state,{kind:"fault"}).accepted);trueWhat it prints (run when this page was built)