World

import { WorldBuilder } from "encompass-ecs";
const world_builder = new WorldBuilder();
const world = world_builder.build();

A World is the glue that holds all the framework elements together.

The World’s update function drives the simulation and should be controlled from your game engine’s update loop.

Functions

update(dt)

Updates the simulation based on given delta time, advancing the simulation by one frame. This involves destroying marked Entities, updating Engines, and cleaning up the Messages at the end of the frame.

Arguments:
  • dt (number) – Delta time.
draw()

Calls the render methods of all Renderers in the World, ordered by the layers on tracked DrawComponents and GeneralRenderers.