.Attraction

Proton .Attraction

new .Attraction(targetPosition, forceopt, radiusopt, lifeopt, easingopt)

This behaviour let the particles follow one specific Proton.Vector2D

Properties:
Name Type Description
targetPosition Proton.Vector2D
radius Number
force Number
radiusSq Number
attractionForce Proton.Vector2D
lengthSq Number
name String

The Behaviour name

Source:
To Do:
  • add description for 'force' and 'radius'
Parameters:
Name Type Attributes Default Description
targetPosition Proton.Vector2D

the attraction point coordinates

force Number <optional>
100
radius Number <optional>
1000
life Number <optional>
Infinity

this behaviour's life

easing String <optional>
Proton.easeLinear

this behaviour's easing

Extends

Methods

applyBehaviour(particle, time, index)

Apply this behaviour for all particles every time

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

the integrate time 1/ms

index Int

the particle index

destroy()

Destory this behaviour

Inherited From:
Source:

initialize(particle)

Initialize the behaviour's parameters for all particles

Inherited From:
Source:
Parameters:
Name Type Description
particle Proton.Particle

normalizeForce(force)

Normalize a force by 1:100;

Inherited From:
Source:
Parameters:
Name Type Description
force Proton.Vector2D

normalizeValue(value)

Normalize a value by 1:100;

Inherited From:
Source:
Parameters:
Name Type Description
value Number

reset(lifeopt, easingopt)

Reset this behaviour's parameters

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

this behaviour's life

easing String <optional>
easeLinear

this behaviour's easing