Skip to main content

CollisionSystem

An Excalibur System that updates entities of certain types. Systems are scene specific

Excalibur Systems currently require at least 1 Component type to operated

Multiple types are declared as a type union For example:

class MySystem extends System {
  public readonly types = ['a', 'b'] as const;
  public readonly systemType = SystemType.Update;
  public update(elapsedMs) {
     ...
  }
}

Hierarchy

Index

Constructors

constructor

Properties

publicpriority

priority: -5 = SystemPriority.Higher

System can execute in priority order, by default all systems are priority 0. Lower values indicated higher priority. For a system to execute before all other a lower priority value (-1 for example) must be set. For a system to execute after all other a higher priority value (10 for example) must be set.

publicquery

publicsystemType

systemType: SystemType = SystemType.Update

Determine whether the system is called in the SystemType.Update or the SystemType.Draw phase. Update is first, then Draw.

Methods

debug

getSolver

initialize

  • initialize(world: World, scene: Scene<unknown>): void
  • Optionally specify an initialize handler


    Parameters

    Returns void

postupdate

  • postupdate(): void
  • Optionally run a postupdate after the system processes matching entities


    Returns void

optionalpreupdate

  • preupdate(scene: Scene<unknown>, elapsedMs: number): void
  • Optionally run a preupdate before the system processes matching entities


    Parameters

    • scene: Scene<unknown>
    • elapsedMs: number

      Time in milliseconds since the last frame

    Returns void

publicrunContactStartEnd

  • runContactStartEnd(): void
  • Returns void

update

  • update(elapsedMs: number): void
  • Update all entities that match this system's types


    Parameters

    • elapsedMs: number

      Time in milliseconds

    Returns void