mwg API
    Preparing search index...

    Interface Particle

    One live particle. Exposed as plain readable state rather than hidden inside the emitter, because that is what makes the simulation testable without a renderer at all: an emitter given no texture runs the whole physics step and draws nothing, so a test drives update(dt) and reads positions directly, the same split Level and TileMap already draw between what a thing is and how it is drawn.

    interface Particle {
        active: boolean;
        age: number;
        alpha: number;
        frame: number;
        life: number;
        rotation: number;
        scale: number;
        spin: number;
        tint: number;
        vx: number;
        vy: number;
        x: number;
        y: number;
    }
    Index
    active: boolean

    false for a pooled particle waiting to be reused

    age: number

    seconds since birth

    alpha: number
    frame: number

    Index into the emitter's frames for this particle's own age, or 0 without a frame sequence. Readable here for the same reason the rest of this interface is: a frame sequence is simulation state (which frame a flame is on), so a test asserts it without a renderer.

    life: number

    seconds this particle lives for

    rotation: number
    scale: number

    current interpolated values, recomputed every step from the emitter's range or curve

    spin: number
    tint: number

    this particle's own tint, picked once at birth from the emitter's range

    vx: number
    vy: number
    x: number
    y: number