.Behaviour

Proton .Behaviour

The Behaviour class is the base for the other Behaviour

Properties:
Name Type Default Description
id String

The behaviours id

age Number 0

How long the particle should be 'alife'

energy Number 1
dead Boolean false

The particle is dead at first

parents Array

The behaviour's parents array

name String

The behaviour name

Source:

Methods

applyBehaviour(particle, time, index)

Apply this behaviour for all particles every time

Source:
Parameters:
Name Type Description
particle Proton.Particle
time Number

the integrate time 1/ms

index Int

the particle index

destroy()

Destory this behaviour

Source:

initialize(particle)

Initialize the behaviour's parameters for all particles

Source:
Parameters:
Name Type Description
particle Proton.Particle

normalizeForce(force)

Normalize a force by 1:100;

Source:
Parameters:
Name Type Description
force Proton.Vector2D

normalizeValue(value)

Normalize a value by 1:100;

Source:
Parameters:
Name Type Description
value Number

reset(lifeopt, easingopt)

Reset this behaviour's parameters

Source:
Parameters:
Name Type Attributes Default Description
life Number <optional>
Infinity

this behaviour's life

easing String <optional>
easeLinear

this behaviour's easing