Constructor
new Particle(emitter, pos, angle, colorStart, colorEnd, lifeTime, sizeStart, sizeEnd, velocityopt, angleVelocityopt)
Create a particle with the passed in settings Typically this is created automatically by a ParticleEmitter
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
emitter | ParticleEmitter | The emitter that created this particle | ||
pos | Vector2 | World or local space position | ||
angle | number | Angle of the particle | ||
colorStart | Color | Color at start of life | ||
colorEnd | Color | Color at end of life | ||
lifeTime | number | How long to live for | ||
sizeStart | number | Size at start of life | ||
sizeEnd | number | Size at end of life | ||
velocity | Vector2 | <optional> | Velocity of the particle | |
angleVelocity | number | <optional> | 0 | Angular speed of the particle |
- Source
Members
angle
Properties| Type | Description |
|---|---|
| number | Angle in radians |
- Source
angleVelocity
Properties| Type | Description |
|---|---|
| number | Angular speed in radians per frame (at 60fps) |
- Source
color
Properties| Type | Description |
|---|---|
| Color | Current color, updated as it renders |
- Source
colorEnd
Properties| Type | Description |
|---|---|
| Color | Color at end of life |
- Source
colorStart
Properties| Type | Description |
|---|---|
| Color | Color at start of life |
- Source
destroyed
Properties| Type | Description |
|---|---|
| boolean | Has this particle been destroyed |
- Source
emitter
Properties| Type | Description |
|---|---|
| ParticleEmitter | The emitter this particle came from |
- Source
groundObject :EngineObject|undefined
- EngineObject |
undefined
| Type | Description |
|---|---|
| EngineObject | | Tile layer it last landed on, undefined in the air |
- Source
lifeTime
Properties| Type | Description |
|---|---|
| number | How long this particle lives for |
- Source
mirror
Properties| Type | Description |
|---|---|
| boolean | If true the tile is flipped along the x axis |
- Source
pos
Properties| Type | Description |
|---|---|
| Vector2 | Position, world space or local to the emitter when localSpace is set |
- Source
size
Properties| Type | Description |
|---|---|
| Vector2 | Current size, updated as it renders |
- Source
sizeEnd
Properties| Type | Description |
|---|---|
| number | Size at end of life |
- Source
sizeStart
Properties| Type | Description |
|---|---|
| number | Size at start of life |
- Source
spawnTime
Properties| Type | Description |
|---|---|
| number | Engine time it was made at |
- Source
tileInfo :TileInfo|undefined
- TileInfo |
undefined
| Type | Description |
|---|---|
| TileInfo | | The emitter's tile, undefined for an untextured one |
- Source
velocity
Properties| Type | Description |
|---|---|
| Vector2 | Velocity in world units per frame (at 60fps) |
- Source
Methods
destroy()
Destroy this particle, once: a second call does nothing
- Source
render()
Render the particle, automatically called each frame
- Source
update()
Update the particle
- Source