The core object of a running game.

See

World

Hierarchy

  • WorldManager

Constructors

Properties

gameTime: number = 0
globals: Record<string, any> = {}
propertyParser: PropertyParser[] = []
resources: ResourceManager

New to TypeSprite?:

Use only the getter/status functions, if at all.

It's better to load resources in the Component with the decorator @res(...) or the Component callback function: beforeWorldStart(loader:WorldStartContext) {...}.

If you like to use this to load custom file types (like loading your own binary map file format etc.) it's better to implement a ResourceLoader.


For advanced devs:

Use this to load/unload additional resources if beforeWorldStart isn't enough. Note that Worlds will load/unload resources when activated/deactivated. Make sure to crawl the code to understand the inner rules.

See

ResourceLoader

textLoader: TextFileProvider
worlds: World[] = []

Methods

  • Sends a message to all entities in all worlds.

    Parameters

    • msgName: string
    • Optional params: any
    • onlyActives: boolean = true

      false => also send it to deactive objects

    • onlyEnabledWorlds: boolean = true

      false => send to objects in disabled worlds too.

    Returns void

Generated using TypeDoc