Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Particle

The single particle object

Hierarchy

  • Particle

Implements

Index

Constructors

constructor

Properties

Readonly bubble

Readonly close

close: boolean

Optional Readonly color

Private Readonly container

container: Container

destroyed

destroyed: boolean

Readonly direction

direction: MoveDirection | keyof typeof MoveDirection | MoveDirectionAlt

Readonly fill

fill: boolean

Readonly id

id: number

Optional Readonly image

Readonly infecter

infecter: Infecter

Readonly initialPosition

initialPosition: Vector

Readonly initialVelocity

initialVelocity: Vector

lastPathTime

lastPathTime: number

lifeDelay

lifeDelay: number

lifeDelayTime

lifeDelayTime: number

lifeDuration

lifeDuration: number

lifeTime

lifeTime: number

links

links: ILink[]

Optional linksDistance

linksDistance: undefined | number

Optional linksWidth

linksWidth: undefined | number

livesRemaining

livesRemaining: number

Readonly loops

Optional maxDistance

maxDistance: undefined | number

misplaced

misplaced: boolean

Optional moveDrift

moveDrift: undefined | number

Optional moveSpeed

moveSpeed: undefined | number

Readonly mover

mover: Mover

Readonly offset

offset: Vector

Readonly opacity

opacity: IParticleValueAnimation<number>

Readonly options

Readonly pathDelay

pathDelay: number

Readonly position

position: Vector

Optional randomIndexData

randomIndexData: undefined | number

Readonly rotate

rotate: IParticleValueAnimation<number>

Readonly shadowColor

shadowColor: IRgb | undefined

Readonly shape

shape: ShapeType | string

Optional Readonly shapeData

shapeData: IShapeValues

Readonly sides

sides: number

Readonly size

Optional sizeAnimationSpeed

sizeAnimationSpeed: undefined | number

spawning

spawning: boolean

splitCount

splitCount: number

Readonly stroke

stroke: Stroke

Optional Readonly strokeColor

Readonly strokeWidth

strokeWidth: number

unbreakable

unbreakable: boolean

Readonly updater

updater: Updater

Readonly velocity

velocity: Vector

Methods

Private calcPosition

Private calculateVelocity

Private checkOverlap

  • checkOverlap(pos: ICoordinates, tryCount?: number): boolean

destroy

  • destroy(override?: undefined | false | true): void
  • Parameters

    • Optional override: undefined | false | true

    Returns void

draw

getFillColor

  • getFillColor(): IHsl | undefined

getMass

  • getMass(): number

getPosition

getRadius

  • getRadius(): number

getStrokeColor

  • getStrokeColor(): IHsl | undefined

Private loadImageShape

move

reset

  • reset(): void
  • This method is used when the particle has lost a life and needs some value resets

    Returns void

Private setColorAnimation

Private split

  • split(): void

update