Particle

Particle

Its a fricking particle!

Constructor

new Particle(pos, radius, lifespanopt)

Source:
Parameters:
Name Type Attributes Default Description
pos Vector2
radius number
lifespan number <optional>
5 In seconds

Classes

Particle

Members

active :boolean

Source:
Type:
  • boolean

color :Object

Source:
Type:
  • Object

(readonly) lifespan :number

Source:
Type:
  • number

(readonly) position :Vector2

Source:
Type:

radius :number

Source:
Type:
  • number

(readonly) velocity :Vector2

Source:
Type:

Methods

draw(ctx)

Description:
  • Renders a particle.
Source:
Parameters:
Name Type Description
ctx CanvasRenderingContext2D

update(ctx, dt)

Description:
  • Updates a particle's lifetime
Source:
Parameters:
Name Type Description
ctx CanvasRenderingContext2D
dt number