LittleJS 1.28.0

Particles

Particle

Particle Object - Created automatically by Particle Emitters

Constructor

new Particle(emitter, pos, angle, colorStart, colorEnd, lifeTime, sizeStart, sizeEnd, velocity, angleVelocity)engineParticles.js:471

Create a particle with the passed in settings Typically this is created automatically by a ParticleEmitter

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, default 0

Angular speed of the particle

Members

Methods

Members

Angle in radians

angleVelocity : numberengineParticles.js:514

Angular speed in radians per frame (at 60fps)

Current color, updated as it renders

Color at end of life

Color at start of life

destroyed : booleanengineParticles.js:523

Has this particle been destroyed

The emitter this particle came from

groundObject : EngineObject|undefinedengineParticles.js:521

Tile layer it last landed on, undefined in the air

lifeTime : numberengineParticles.js:506

How long this particle lives for

mirror : booleanengineParticles.js:518

If true the tile is flipped along the x axis

Position, world space or local to the emitter when localSpace is set

The emitter's scale when it was made, which grows its fall

Current size, updated as it renders

sizeEnd : numberengineParticles.js:510

Size at end of life

sizeStart : numberengineParticles.js:508

Size at start of life

spawnTime : numberengineParticles.js:516

Engine time it was made at

tileInfo : TileInfo|undefinedengineParticles.js:526

The emitter's tile, undefined for an untextured one

Velocity in world units per frame (at 60fps)

Methods

Destroy this particle, once: a second call does nothing

Render the particle, automatically called each frame

Update the particle