Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Particle

Particle is used in a ParticleEmitter

Hierarchy

  • Particle

Index

Constructors

constructor

  • Parameters

    • emitter: ParticleEmitter
    • Optional life: number
    • Optional opacity: number
    • Optional beginColor: Color
    • Optional endColor: Color
    • Optional position: Vector
    • Optional velocity: Vector
    • Optional acceleration: Vector
    • Optional startSize: number
    • Optional endSize: number

    Returns Particle

Properties

Private _aRate

_aRate: number = 0

Private _bRate

_bRate: number = 1

Private _currentColor

_currentColor: Color = Color.White.clone()

Private _gRate

_gRate: number = 1

Private _rRate

_rRate: number = 1

acceleration

acceleration: Vector = new Vector(0, 0)

beginColor

beginColor: Color = Color.White.clone()

currentRotation

currentRotation: number = 0

elapsedMultiplier

elapsedMultiplier: number = 0

emitter

emitter: ParticleEmitter = null

endColor

endColor: Color = Color.White.clone()

endSize

endSize: number

fadeFlag

fadeFlag: boolean = false

focus

focus: Vector = null

focusAccel

focusAccel: number = 0

life

life: number = 300

opacity

opacity: number = 1

particleRotationalVelocity

particleRotationalVelocity: number = 0

particleSize

particleSize: number = 5

particleSprite

particleSprite: Sprite = null

position

position: Vector = new Vector(0, 0)

sizeRate

sizeRate: number = 0

startSize

startSize: number

velocity

velocity: Vector = new Vector(0, 0)

Methods

draw

  • draw(ctx: CanvasRenderingContext2D): void
  • Parameters

    • ctx: CanvasRenderingContext2D

    Returns void

kill

  • kill(): void
  • Returns void

update

  • update(delta: number): void
  • Parameters

    • delta: number

    Returns void