Explanation before level 1

Hierarchy

  • CutScene
    • BeforeLevel1

Implements

Constructors

  • Returns BeforeLevel1

Properties

camera: Camera

Gets or sets the current camera for the scene

engine: Engine

Access to the Excalibur engine

events: EventEmitter<SceneEvents>
nextScene: string = "level1"

The name of the next scene, the scene the player will go to after passing the exit gate.

physics: PhysicsWorld

The Excalibur physics world for the scene. Used to interact with colliders included in the scene.

Can be used to perform scene ray casts, track colliders, broadphase, and narrowphase.

text: string[] = ...
thisScene: string = "beforeLevel1"

The (unique) name of this scene.

world: World<BeforeLevel1>

The ECS world for the scene

Accessors

  • get actors(): readonly Actor[]
  • The actors in the current scene

    Returns readonly Actor[]

  • get entities(): readonly Entity[]
  • The entities in the current scene

    Returns readonly Entity[]

  • get isInitialized(): boolean
  • Gets whether or not the [[Scene]] has been initialized

    Returns boolean

  • get tileMaps(): readonly TileMap[]
  • The [[TileMap]]s in the scene, if any

    Returns readonly TileMap[]

  • get timers(): readonly Timer[]
  • Returns readonly Timer[]

  • get triggers(): readonly Trigger[]
  • The triggers in the current scene

    Returns readonly Trigger[]

Methods

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Activates the scene with the base behavior, then calls the overridable onActivate implementation.

    Parameters

    • context: SceneActivationContext<unknown>

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Deactivates the scene with the base behavior, then calls the overridable onDeactivate implementation.

    Parameters

    • context: SceneActivationContext<never>

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Initializes the scene before the first update, meant to be called by engine not by users of Excalibur

    Parameters

    • engine: Engine

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Internal _postdraw handler for [[onPostDraw]] lifecycle event

    Parameters

    • _ctx: ExcaliburGraphicsContext
    • _delta: number

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Internal _preupdate handler for [[onPostUpdate]] lifecycle event

    Parameters

    • _engine: Engine
    • delta: number

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Internal _predraw handler for [[onPreDraw]] lifecycle event

    Parameters

    • _ctx: ExcaliburGraphicsContext
    • _delta: number

    Returns void

  • Internal

    It is not recommended that internal excalibur methods be overridden, do so at your own risk.

    Internal _preupdate handler for [[onPreUpdate]] lifecycle event

    Parameters

    • _engine: Engine
    • delta: number

    Returns void

  • Adds a [[Timer]] to the current [[Scene]].

    Parameters

    • timer: Timer

      The timer to add to the current [[Scene]].

    Returns void

  • Adds a [[TileMap]] to the [[Scene]], once this is done the [[TileMap]] will be drawn and updated.

    Parameters

    • tileMap: TileMap

    Returns void

  • Adds a [[Trigger]] to the [[Scene]], once this is done the [[Trigger]] will listen for interactions with other actors.

    Parameters

    • trigger: Trigger

    Returns void

  • Adds an actor to the scene, once this is done the [[Actor]] will be drawn and updated.

    Parameters

    • actor: Actor

      The actor to add to the current scene

    Returns void

  • Adds an [[Entity]] to the scene, once this is done the [[Actor]] will be drawn and updated.

    Parameters

    • entity: Entity

      The entity to add to the current scene

    Returns void

  • Adds a [[ScreenElement]] to the scene.

    Parameters

    • screenElement: ScreenElement

      The ScreenElement to add to the current scene

    Returns void

  • Adds a [[Timer]] to the scene

    Parameters

    • timer: Timer

      The timer to add

    Returns Timer

  • Cancels a [[Timer]], removing it from the scene nicely

    Parameters

    • timer: Timer

      The timer to cancel

    Returns Timer

  • Removes all entities and timers from the scene, optionally indicate whether deferred should or shouldn't be used.

    By default entities use deferred removal

    Parameters

    • Optional deferred: boolean

    Returns void

  • Checks whether an actor is contained in this scene or not

    Parameters

    • actor: Actor

    Returns boolean

  • Draws all the actors' debug information in the Scene. Called by the [[Engine]].

    Parameters

    • ctx: ExcaliburGraphicsContext

      The current rendering context

    Returns void

  • Draws all the actors in the Scene. Called by the [[Engine]].

    Parameters

    • ctx: ExcaliburGraphicsContext

      The current rendering context

    • delta: number

      The number of milliseconds since the last draw

    Returns void

  • Type Parameters

    • TEventName extends EventKey<SceneEvents>

    Parameters

    Returns void

  • Parameters

    • eventName: string
    • Optional event: any

    Returns void

  • Returns boolean

  • Tests whether a [[Timer]] is active in the scene

    Parameters

    • timer: Timer

    Returns boolean

  • Type Parameters

    • TEventName extends EventKey<SceneEvents>

    Parameters

    Returns void

  • Parameters

    • eventName: string
    • handler: Handler<unknown>

    Returns void

  • Parameters

    • eventName: string

    Returns void

  • Type Parameters

    • TEventName extends EventKey<SceneEvents>

    Parameters

    Returns Subscription

  • Parameters

    • eventName: string
    • handler: Handler<unknown>

    Returns Subscription

  • This is called when the scene is made active and started. It is meant to be overridden, this is where you should setup any DOM UI or event handlers needed for the scene.

    Parameters

    • _context: SceneActivationContext<unknown>

    Returns void

  • This is called when the scene is made transitioned away from and stopped. It is meant to be overridden, this is where you should cleanup any DOM UI or event handlers needed for the scene.

    Parameters

    • _context: SceneActivationContext<undefined>

    Returns void

  • Parameters

    • engine: Engine

    Returns void

  • Safe to override onPostDraw lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})

    onPostDraw is called directly after a scene is drawn.

    Parameters

    • _ctx: ExcaliburGraphicsContext
    • _delta: number

    Returns void

  • Safe to override onPostUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})

    onPostUpdate is called directly after a scene is updated.

    Parameters

    • _engine: Engine
    • _delta: number

    Returns void

  • Safe to override onPreDraw lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})

    onPreDraw is called directly before a scene is drawn.

    Parameters

    • _ctx: ExcaliburGraphicsContext
    • _delta: number

    Returns void

  • Safe to override onPreUpdate lifecycle event handler. Synonymous with .on('preupdate', (evt) =>{...})

    onPreUpdate is called directly before a scene is updated.

    Parameters

    • _engine: Engine
    • _delta: number

    Returns void

  • Type Parameters

    • TEventName extends EventKey<SceneEvents>

    Parameters

    Returns Subscription

  • Parameters

    • eventName: string
    • handler: Handler<unknown>

    Returns Subscription

  • Removes a [[Timer]] from the current scene, it will no longer be updated.

    Parameters

    • timer: Timer

      The timer to remove to the current scene.

    Returns void

  • Removes a [[TileMap]] from the scene, it will no longer be drawn or updated.

    Parameters

    • tileMap: TileMap

      {TileMap}

    Returns void

  • Removes an actor from the scene, it will no longer be drawn or updated.

    Parameters

    • actor: Actor

      The actor to remove from the current scene.

    Returns void

  • Parameters

    • entity: Entity

    Returns void

  • Removes a [[ScreenElement]] to the scene, it will no longer be drawn or updated

    Parameters

    • screenElement: ScreenElement

      The ScreenElement to remove from the current scene

    Returns void

  • Removes a [[Timer]] from the scene.

    Parameters

    • timer: Timer

      The timer to remove

    Returns Timer

    Warning

    Can be dangerous, use [[cancelTimer]] instead

  • Removes a [[Timer]] from it's current scene and adds it to this scene.

    Useful if you want to have an object be present in only 1 scene at a time.

    Parameters

    • timer: Timer

      The Timer to transfer to the current scene

    Returns void

  • Removes a [[TileMap]] from it's current scene and adds it to this scene.

    Useful if you want to have an object be present in only 1 scene at a time.

    Parameters

    • tileMap: TileMap

      The TileMap to transfer to the current scene

    Returns void

  • Removes a [[Trigger]] from it's current scene and adds it to this scene.

    Useful if you want to have an object be present in only 1 scene at a time.

    Parameters

    • trigger: Trigger

      The Trigger to transfer to the current scene

    Returns void

  • Removes an [[Actor]] from it's current scene and adds it to this scene.

    Useful if you want to have an object be present in only 1 scene at a time.

    Parameters

    • actor: Actor

      The Actor to transfer to the current scene

    Returns void

  • Removes an [[Entity]] from it's current scene and adds it to this scene.

    Useful if you want to have an object be present in only 1 scene at a time.

    Parameters

    • entity: Entity

      The Entity to transfer to the current scene

    Returns void

  • Removes a [[ScreenElement]] from it's current scene and adds it to this scene.

    Useful if you want to have an object be present in only 1 scene at a time.

    Parameters

    • screenElement: ScreenElement

      The ScreenElement to transfer to the current scene

    Returns void

  • Updates all the actors and timers in the scene. Called by the [[Engine]].

    Parameters

    • engine: Engine

      Reference to the current Engine

    • delta: number

      The number of milliseconds since the last update

    Returns void

Generated using TypeDoc