definePhysics
definePhysics(
options):PhysicsSettings
Declares a game’s physics scene: its gravity, its solver’s passes and
the height below which a falling body is destroyed. Export it from
src/game.ts as physics, pass it to <Game physics>, and re-export it
from the room’s scene file beside the plugins, as
export { plugins, physics } from "../game": a page and its room
compare it at the welcome. Each setting left out takes its default, and
a game that declares nothing steps with every default. Throws on a
setting no scene can step with, naming it.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
PhysicsOptions |
Returns
Section titled “Returns”Example
Section titled “Example”export const physics = definePhysics({ gravity: [0, -20, 0] });