Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.
Eric McDaniel edited this page Oct 25, 2021 · 7 revisions

A world is the root object in Harmony. Worlds manage schemas, entities and their components.

A world is created with World.make. This function requires a single parameter which configures the default number of entities in your ECS.

import { World } from "harmony-ecs"

const world = World.make(1_000_000)

The Harmony API is primarily a collection of objects comprised of functions. Most of these functions accept a world as the first parameter:

import { Schema, Entity, Query, formats } from "harmony-ecs"

const Health = Schema.make(world, formats.uint32)
const Healthy = [Health] as const
Entity.make(world, Healthy)
Query.make(world, Healthy)
// etc
Clone this wiki locally