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:
color :Object
- Source:
Type:
(readonly) lifespan :number
- Source:
Type:
(readonly) position :Vector2
- Source:
Type:
radius :number
- Source:
Type:
(readonly) velocity :Vector2
- Source:
Type:
Methods
draw(ctx)
- Description:
- 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
|
|