createHeadlessGame
createHeadlessGame(
headlessGameOptions):Promise<HeadlessGame>
A world with the ground from the seeded map and the scene’s entities,
ready to step: the physics wasm and the scatter shapes are loaded before
it returns, and on a dev world the prediction checks, so they run from
its first step. From @spawnite/engine/core:
const game = await createHeadlessGame({ scene: spawnCoins, plugins }),
then stepSeconds(game, 1), then game.world.destroy(), as
Headless tests shows.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
headlessGameOptions |
HeadlessGameOptions |
Returns
Section titled “Returns”Promise<HeadlessGame>