Options
All
  • Public
  • Public/Protected
  • All
Menu
classdesc

Creates a DuckEngine ParticleEmitter

description

The ParticleEmitter Class. Emits, creates, and destroys particles

since

1.0.0-beta

Hierarchy

  • ParticleEmitter

Index

Constructors

constructor

  • description

    Creates ParticleEmitter instance

    since

    1.0.0-beta

    Parameters

    • particle: Particle

      Base particle that is cloned and modified from

    • rangeX: Range

      Where the new emitted particles x position is. A range of 2 values

    • rangeY: Range

      Where the new emitted particles y position is. A range of 2 values

    • amount: number

      Amount of starting particles

    • game: Game

      Game instance

    • scene: Scene

      Scene instance

    • autoCreate: boolean = true

    Returns ParticleEmitter

Properties

Readonly amount

amount: number
memberof

ParticleEmitter

description

The starting amount of particle

since

1.0.0-beta

emitting

emitting: boolean
memberof

ParticleEmitter

description

Determines if the ParticleEmitter is emitting or not

since

1.0.0-beta

enabled

enabled: boolean
memberof

ParticleEmitter

description

Determines if the ParticleEmitter is enabled or not

since

2.0.0

Protected floatRangeX

floatRangeX: Range

Protected floatRangeY

floatRangeY: Range

game

game: Game
memberof

ParticleEmitter

description

Game instance

since

1.0.0-beta

Readonly id

id: string
memberof

ParticleEmitter

description

A unique identifier for the ParticleEmitter

since

1.0.0-beta

list

list: Particle[]
memberof

ParticleEmitter

description

The list of current particles

since

1.0.0-beta

Protected particle

particle: Particle

rangeX

rangeX: Range
memberof

ParticleEmitter

description

A range of numbers where particle x pos will be

since

1.0.0-beta

rangeY

rangeY: Range
memberof

ParticleEmitter

description

A range of numbers where particle y pos will be

since

1.0.0-beta

scene

scene: Scene
memberof

ParticleEmitter

description

Scene instance

since

1.0.0-beta

Methods

create

  • create(): void

createOne

  • createOne(): void

emit

  • emit(): void

emitFor

  • emitFor(ms: number): void

float

  • memberof

    ParticleEmitter

    description

    Sets the floatVelocity of all particles in between a range

    since

    1.0.0-beta

    Parameters

    • rangeVX: Range

      A range of 2 values for the floatVelocity.x, randomly chosen between that range

    • rangeVY: Range

      A range of 2 values for the floatVelocity.y, randomly chosen between that range

    Returns void

keepEmitting

  • keepEmitting(intervalMS: number, limitTo?: number): void
  • memberof

    ParticleEmitter

    description

    Spawns new particles after the initial particles

    since

    1.0.0-beta

    Parameters

    • intervalMS: number

      How often a new particle gets spawned

    • Optional limitTo: number

    Returns void

offloadBounds

offloadMaxAge

  • offloadMaxAge(ageInSeconds: number): void
  • memberof

    ParticleEmitter

    description

    Offloads particles based on how many seconds they existed for

    since

    1.0.0

    Parameters

    • ageInSeconds: number

      Max amount of seconds a particle existed for

    Returns void

offloadMaxAmount

  • offloadMaxAmount(limit: number): void

setFillColor

  • setFillColor(fillColor: string): void

setImagePath

  • setImagePath(imagePath: string): void

setRange

  • memberof

    ParticleEmitter

    description

    Sets the new or old particles' position range

    since

    1.0.0-beta

    Parameters

    • rangeX: Range

      Where the new emitted particles x position is. A range of 2 values

    • rangeY: Range

      Where the new emitted particles y position is. A range of 2 values

    Returns void

setVelocity

  • setVelocity(axis: "x" | "y", v: number): void
  • memberof

    ParticleEmitter

    description

    Sets the velocity of all particles

    since

    1.0.0-beta

    Parameters

    • axis: "x" | "y"

      'x' or 'y' axis to change the velocity of all particles

    • v: number

      Value to set the velocity of all particles

    Returns void

stopEmit

  • stopEmit(): void

wobble

  • wobble(v: number): void

Generated using TypeDoc