Developer   API   Game Development   Particle System   Particle

Particle

Particle is a abstract entity with a small set of attributes such as position and color that ultimately dictate the particle's behavior and appearance.

Properties

  • acceleration() : Vector
    Particle acceleration.
  • lived() : Integer
    Age of the particle, define time how long particle can be alive.
  • position() : Vector
    Location of the particle center.
  • ttl() : Integer
    Time to live, default is set to -1.
  • velocity() : Vector
    Velocity vector (direction and speed).

Methods

  • alive() : Boolean
    Check if particle is a live.
  • draw(canvas)
    Method draw defines action whithin onDraw.
  • init()
    Init instance.
  • move()
    Method to move particle based on acceleration and velocity vector.
  • submitToFields(fields)
    Submit fields.

Events

  • onDraw(canvas) : Function
    Event fired on Draw of particle.