Interface TGameObject<TSprite, TBody>

interface TGameObject<TSprite, TBody> {
    body: TBody;
    children: LifecycleProps[];
    destroy$: Subject<void>;
    label: string;
    scene?: SceneBase<Body> | Scene<Body>;
    sprite: TSprite;
    target?: Vector;
    update$: Subject<number>;
    x: number;
    y: number;
    addChild(...children): void;
    destroy(): void;
    getChildOfType(type): LifecycleProps;
    getChildrenOfType(type): LifecycleProps[];
    removeChild(...children): void;
    update(deltaTime): void;
}

Type Parameters

Hierarchy (view full)

Properties

body: TBody
children: LifecycleProps[] = []

Each GameObject has children Lifecycle Objects.

destroy$: Subject<void> = ...

When Lifecycle Object is destroyed, it emits and closes this subject. Along with destroying his children, which in turn behave the same.

label: string

Each Lifecycle Object has label for pixi debugging.

scene?: SceneBase<Body> | Scene<Body>

Lifecycle Object may be added to a Scene Object.

sprite: TSprite
target?: Vector
update$: Subject<number> = ...

When Lifecycle Object is updated, it emits this subject. Along with updating his children, which in turn behave the same.

x: number

position x

y: number

position y

Methods

  • Updates the Lifecycle Object with actual deltaTime ~60fps

    Parameters

    • deltaTime: number

    Returns void