Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

  • new Universe(__namedParameters?: { bounds: undefined | { bottom: number; left: number; right: number; top: number }; creationDuration: number; creationTimingFn: (t: number) => number; deathDuration: number; deathTimingFn: (t: number) => number; frameRate: number; onStateChange: undefined | ((state: UniverseState, universe: Universe) => void) }): Universe
  • Parameters

    • Default value __namedParameters: { bounds: undefined | { bottom: number; left: number; right: number; top: number }; creationDuration: number; creationTimingFn: (t: number) => number; deathDuration: number; deathTimingFn: (t: number) => number; frameRate: number; onStateChange: undefined | ((state: UniverseState, universe: Universe) => void) } = {}
      • bounds: undefined | { bottom: number; left: number; right: number; top: number }
      • creationDuration: number
      • creationTimingFn: (t: number) => number
          • (t: number): number
          • Parameters

            • t: number

            Returns number

      • deathDuration: number
      • deathTimingFn: (t: number) => number
          • (t: number): number
          • Parameters

            • t: number

            Returns number

      • frameRate: number
      • onStateChange: undefined | ((state: UniverseState, universe: Universe) => void)

    Returns Universe

Properties

Private creationDuration

creationDuration: number

Private creationRate

creationRate: number = 1

Private creationTimingFn

creationTimingFn: TimingFunction

Private deathDuration

deathDuration: number

Private deathRate

deathRate: number = 1

Private deathTimingFn

deathTimingFn: TimingFunction

Private frameRate

frameRate: number

Private health

health: number = 0

Private Optional onStateChange

onStateChange: undefined | ((state: UniverseState, universe: Universe) => void)

Private resolveDeath

resolveDeath: (value?: any) => void

Type declaration

    • (value?: any): void
    • Parameters

      • Optional value: any

      Returns void

Private state

Methods

addParticle

addParticleForce

Private applyDecay

Private applyGrowth

createSubverse

die

  • die(): Promise<void>

getParticleForces

getParticles

removeParticle

  • removeParticle(particle: Particle): void

removeParticleForce

removeSubverse

  • removeSubverse(subverse: Subverse): void

setCreationDuration

  • setCreationDuration(creationDuration: number): void

setDeathDuration

  • setDeathDuration(deathDuration: number): void

setFrameRate

  • setFrameRate(frameRate: number): void

setOnStateChange

Private setState

tick

  • tick(): void

Generated using TypeDoc