Options
All
  • Public
  • Public/Protected
  • All
Menu

This class is responsible for the type of events that are placed in the map. Generally, this kind of events are fired when the hero reaches the position of where an event of this type is placed.

Hierarchy

Index

Constructors

constructor

  • new TileEvent(game: any, data: any, type: any, x: any, y: any, activation_directions: any, activation_collision_layers: any, dynamic: any, active: any, active_storage_key: any, origin_interactable_object: any, affected_by_reveal: any, key_name: any): TileEvent
  • Parameters

    • game: any
    • data: any
    • type: any
    • x: any
    • y: any
    • activation_directions: any
    • activation_collision_layers: any
    • dynamic: any
    • active: any
    • active_storage_key: any
    • origin_interactable_object: any
    • affected_by_reveal: any
    • key_name: any

    Returns TileEvent

Properties

Protected _activation_collision_layers

_activation_collision_layers: number[]

Protected _activation_directions

_activation_directions: number[]

Protected _active

_active: boolean[]

Protected _affected_by_reveal

_affected_by_reveal: boolean[]

Protected _dynamic

_dynamic: boolean

Protected _id

_id: number

Protected _key_name

_key_name: string

Protected _location_key

_location_key: number

Protected _origin_interactable_object

_origin_interactable_object: InteractableObjects

Protected _type

Protected _x

_x: number

Protected _y

_y: number

Private active_storage_key

active_storage_key: string

collision_layer_shift_from_source

collision_layer_shift_from_source: number

Protected data

data: GoldenSun

Protected game

game: Game

Static Protected events

events: {}

Type declaration

Static Protected id_incrementer

id_incrementer: number

Static Protected labeled_events

labeled_events: {}

Type declaration

Accessors

activation_collision_layers

  • get activation_collision_layers(): number[]

activation_directions

  • get activation_directions(): number[]

active

  • get active(): boolean[]
  • This array has the same size of activation directions. The indexes of this array matches activation_directions in the way that it tells whether a given activation_direction is active by checking this var in the same corresponding index. Example: if active[2] is false, it means that this event is not active in the direction holded in activation_directions[2].

    Returns boolean[]

affected_by_reveal

  • get affected_by_reveal(): boolean[]

dynamic

  • get dynamic(): boolean

id

  • get id(): number

key_name

  • get key_name(): string

location_key

  • get location_key(): number

origin_interactable_object

type

x

  • get x(): number

y

  • get y(): number

Methods

activate

  • activate(): void

activate_at

check_position

  • check_position(): boolean
  • Checks whether the hero is iver this tile event.

    Returns boolean

    whether the hero position is correct or not.

deactivate

  • deactivate(): void

deactivate_at

Abstract destroy

  • destroy(): void

Abstract fire

  • fire(): void

is_active

set_activation_collision_layers

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

    Parameters

    • Rest ...collision_layers_indexes: number[]

      the collision layers index.

    Returns void

set_position

  • 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

Static Private format_activation_directions

  • format_activation_directions(input: any): any

Static get_event

Static get_labeled_event

  • get_labeled_event(key_name: string): TileEvent
  • Gets an event by its unique label/key name.

    Parameters

    • key_name: string

      the event unique label/key name.

    Returns TileEvent

    returns the TileEvent instance.

Static reset

  • reset(): void

Generated using TypeDoc