Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is responsible for the class of events that are placed on the map. Generally, this kind of event is fired when the hero reaches the position where an event of this type is placed. Use these events to make the hero jump, slide, climb, teleport, etc. Tile Events are set as map properties (and sometimes, Interactable Objects can also create some Tile Events automatically).

Hierarchy

Index

Constructors

  • new TileEvent(game: any, data: any, type: any, x: any, y: any, activation_directions: any, initial_disabled_directions: any, activation_collision_layers: any, active_storage_key: any, origin_interactable_object: any, affected_by_reveal: any, key_name: any, allow_active_in_diagonal?: boolean): TileEvent
  • Parameters

    • game: any
    • data: any
    • type: any
    • x: any
    • y: any
    • activation_directions: any
    • initial_disabled_directions: any
    • activation_collision_layers: any
    • active_storage_key: any
    • origin_interactable_object: any
    • affected_by_reveal: any
    • key_name: any
    • allow_active_in_diagonal: boolean = true

    Returns TileEvent

Properties

_activation_collision_layers: Set<number>
_activation_directions: Set<directions>
_affected_by_reveal: Set<directions>
_allow_active_in_diagonal: boolean
_id: number
_initial_activation_directions: Set<directions>
_initial_disabled_directions: Set<directions>
_key_name: string
_location_key: number
_origin_interactable_object: InteractableObjects
_x: number
_y: number
active_storage_key: string
collision_layer_shift_from_source: number

The collision layer shift value from origin Inter. Obj. base collision layer that will be summed up to it which will form the activation collision layer of this event.

data: GoldenSun
game: Game
in_map: boolean

Whether this event is in the map.

_events: {}

Type declaration

id_incrementer: number
labeled_events: {}

Type declaration

Accessors

  • get activation_collision_layers(): Set<number>
  • get allow_active_in_diagonal(): boolean
  • When activating this event in diagonal, and if this var is not true, the diagonal direction whether the hero is trying to activate this event won't be splitted.

    Returns boolean

  • get id(): number
  • get initial_activation_directions(): Set<directions>
  • get key_name(): string
  • get location_key(): number
  • get x(): number
  • get y(): number
  • get events(): {}

Methods

  • activate(include_affected_by_reveal?: boolean): void
  • Activates this event in all initial directions.

    Parameters

    • include_affected_by_reveal: boolean = false

      if true, it will also make this event sensible to reveal.

    Returns void

  • Activates this event in a given direction.

    Parameters

    • direction: directions | "all"

      the direction to activate this event. If "all" is passed, all directions will be activated.

    Returns void

  • check_if_disabled_by_storage(): boolean
  • check_position(): boolean
  • deactivate(): void
  • deactivate_at(direction: directions | "all"): void
  • Deactivates this event in a given direction.

    Parameters

    • direction: directions | "all"

      the direction to deactivate this event. If "all" is passed, all directions will be deactivated.

    Returns void

  • destroy(): void
  • fire(): void
  • is_active(): boolean
  • is_active_at_collision_layer(collision_layer: number): boolean
  • Checks if this event is active in a given collision layer.

    Parameters

    • collision_layer: number

      the collision layer index to be checked.

    Returns boolean

  • is_active_at_direction(direction?: directions): boolean
  • Tests whether a given direction is available to active this event. If no directions given, tests if at least one direction is active.

    Parameters

    • Optional direction: directions

      the direction to test if it's active.

    Returns boolean

    Returns whether it's active or not.

  • set_activation_collision_layers(...collision_layers_indexes: number[]): void
  • Sets new collision layers that this event can active.

    Parameters

    • Rest ...collision_layers_indexes: number[]

      the collision layers indexes.

    Returns void

  • set_position(x_tile?: number, y_tile?: number, change_in_map?: boolean): void
  • Updates the position of this event.

    Parameters

    • Optional x_tile: number

      the new x tile position.

    • Optional y_tile: number

      the new y tile position

    • change_in_map: boolean = false

      folow the position change up to map events list.

    Returns void

  • update(): void
  • format_activation_directions(input: string | string[], undefined_is_all?: boolean): directions[]
  • get_labeled_event(key_name: string): TileEvent
  • reset(): void

Generated using TypeDoc