dino-ge
    Preparing search index...

    Class defaultAbstract

    Base class for all entities in the game world.

    Hierarchy (View Summary)

    Index

    Constructors

    • initialises a new instance of a GameObject.

      Parameters

      • tag: string = 'obj'

        A descriptive name for the object.

      • zIndex: number = 0

        The rendering order (higher numbers are drawn on top).

      • OptionalsourceId: string

        Hidden identifier linking runtime object to its source code location.

      Returns default

    Properties

    id: string = ...

    Unique identifier for the game object.

    _registry: typeof default = Registry

    Static helper for tests to bypass Registry circularity if mocked.

    Accessors

    Methods

    • Emits a custom event on this object's event bus.

      Parameters

      • type: string

        The event type.

      • Optionaldetail: unknown

        Optional data to pass with the event.

      Returns void

    • Stops listening for an event on this object's event bus.

      Parameters

      • type: string

        The event type.

      • callback: (event: CustomEvent) => void

        The function to remove.

      Returns void

    • Listens for an event on this object's event bus.

      Parameters

      • type: string

        The event type.

      • callback: (event: CustomEvent) => void

        The function to run when the event occurs.

      Returns void