Skip to main content

Function: createWorld()

createWorld(name, game, worldCreationOptions?): WorldCreationResult

Defined in: ecs/utilities/create-world.ts:54

Creates a new world with the specified name and registers it with the game. Sets up the camera and input systems, and returns the created world and its components.

Parameters

name

string

The name of the world to create.

game

Game

The game instance to register the world with.

worldCreationOptions?

Partial<WorldCreationOptions>

Optional parameters for customizing the world creation.

Returns

WorldCreationResult

An object containing the created world, layer service, camera entity, inputs entity and render layers.