Generic tween object to be used to transition this map filters.
If true, sprites in middlelayer_group won't be sorted.
An object containing which filters are active in this char.
The battle background key of this map.
Gets the map collision body for current collision layer.
The current active collision layer.
The number of collision layers of this map.
The sprite without texture just responsible to enable the map collision body.
The Phaser.Filter object responsible for this map texture color control.
Gets the current bounding box object ID.
Gets the enemy party encounter cumulator value.
The list of TileEvents of this map.
An object of generic sprites that can be created by Game Events.
The Phaser.Filter object responsible for this map saturation control.
The list of Interactable Objects of this map.
The object that holds the Interactable Objects of this map that have a label.
The internal storage keys created for objects of this map.
Whether this map is world map or not.
The map key name.
The list of layers of this map.
Whether this map will load its assets only when the hero reaches it.
Gets the window object that shows this map's name.
The Phaser.Filter object responsible for this map mode7.
The map name.
The list of NPCs of this map.
The object that holds the NPCs of this map that have a label.
Whether the map is paused or not.
Gets Retreat psynergy info. Returns the x and y tile posoition to retreat and the destination collision index and direction.
Gets the collision layer index that sand psynergy will use.
Whether this map has chars footprint system enabled.
Whether this map will show its name on teleport.
The map main sprite.
The tile height of this map.
The tile width of this map.
Adds a generic sprite to this map.
the generic sprite key name.
the x position in px.
the y position in px.
the Phaser.Group to be in.
some options.
The animation action key.
The sprite alpha value.
The sprite ancho x value.
The sprite ancho y value.
The animation key.
The collision layer that the sprite will be. Important when sorting sprites.
The frame key name to be set for this sprite.
The frame rate of the animation.
Whether the animation will loop.
If true, an animation of this sprite will be started.
The sprite rotation value.
The sprite scale x value.
The sprite scale y value.
If true, the sprite will be sorted under NPC layers.
returns the generated sprite.
Update function to check whether BGMs should be played if the hero is inside the specified regions.
Checks whether a NPC or Interactable object has its body on map.
the NPC or Interactable Object instance.
whether the body is in the map or not.
Updates camera bounds to fit current portion of the map.
Configs map, npc and interactable objects collision bodies.
the collsion layer index.
Creates and setups the map collision bodies. Collision bodies for maps may come from physics json file or object layers from a Tiled map.
the collsion layer index.
Initializes all the interactable objects of this map.
Creates, initializes and organize the map layers sprites.
if true, it will only reorganize the layers. It's expected that the layers were already created.
Initializes all the NPCs of this map.
Initializes a single NPC in this map.
the npc to be initialized.
the map unique index of this interactable object.
an initial custom position for this npc in px.
Initializes some world map custom features of this map in the case it's a world map.
Creates an interactable object.
the property name.
the properties of this interactable object still not parsed.
the map unique index of this interactable object.
returns the created interactable object.
Creates a NPC.
the property name.
the properties of this NPC, parsed or not.
whether the properties are parsed or not.
the map unique index of this NPC.
returns the created npc.
Creates a tile event.
the property name.
the properties of this event still not parsed.
returns the created event.
Fires this map game events.
the set type of map events that will be fired.
Get the tiles that a ControllableChar is over.
the ControllableChar.
if this is not specified, it's returned all tiles for the char position.
returns a tile object: Phaser.Tile or Phaser.Tile[] if multiple layers.
Gets the zones that the hero is in. Zones are only available if hero is moving.
a Set of zones.
Creates a NPC representing the djinn to be gotten and a game event to get this djinn.
the djinn key to be gotten.
return the fire event function of the DjinnEvent instance created in this function.
Get a specific layer.
the layer name.
return the layer.
Checks if a given tile position has IOs or NPCs, if yes return a list of them.
the x tile position.
the y tile position.
the collision layer of tile. If not passed, gets the current one.
Returns a list of NPCs and IOs based on constraints given.
Checks whether this map has the given tile event placed somewhere.
the id of the tile event.
whether the given tile event is on the map.
Initializes game events of this map.
list of input events before parse.
the type of game event that's being intialized.
the property key name in case of "options_list" game event type.
Initializes internal storage keys with snapshot info.
the snapshot init object.
Initializes the window that shows the map name when entering on it.
Checks if a given tile position is blocked by a collision object.
the x tile position.
the y tile position.
the collision layer of tile. If not passed, gets the current one.
if true, will also check for NPCs and IOs.
Returns whether the given position is blocked or not.
Loads the map assets like tileset and background music.
if true, forces the loading process to start.
on load complete callback.
Sets or unsets a Phaser.Filter in this map.
the filter you want to set.
whether it's to set or unset the filter.
specify a layer if you want that this filter management should be only for the given layer.
This is the main function of this class. It mounts the map.
the initial collision layer.
the initial encounter cumulator. If not passed, it's reset.
an object that holds the x and y tile positions that the hero will be.
retreat data that can be propagated from previous map if it has the same key name.
returns the mounted map.
Parses the over property of a given layer.
the over property value.
returns -1 if under the hero or the threshold collision layer to be under.
Pauses map activity, like collisions, npc and interactable objects animation etc.
return the current map state.
Pre processor the map collision polygons in order to limit their size to a tile size.
Processes Tiled layers to check whether they have configs related to collision, encounter zones and bounding boxes.
Removes a NPC or an IO collision track from this map.
the NPC or IO instance.
the x tile position.
the y tile position.
the collision index.
Removes a tile event in a custom location.
the LocationKey of the event.
the id of the event.
returns true if the event was removed.
Removes a generic sprite from this map.
the generic sprite key name.
return true if the sprite was removed.
Removes a NPC from this map.
the npc to be removed.
if true, will also unset the npc.
Resumes map activity, like collisions, npc and interactable objects animation etc.
the map state when it was paused.
Sets whether a tile should collide or not. Only works if there's at least on collision body in the given tile position.
the x tile position.
the y tile position.
whether it should collide or not.
the collision layer of tile. If not passed, gets the current one.
Sets a storage key identifier for a NPC or Interactable Object in order to hold values internally if this map is unmounted.
is true, will set the key for a NPC, otherwise for an Interactable Object.
the storage key type.
the storage key.
the NPC or Interactable Object index in this map.
Checks what is the suitable bounding box for the given position. If no bounding box found, will fit map bounds to world size.
the x tile position.
the y tile position.
if true, will apply the bounds to camera.
Sorts the sprites in the GoldenSun.middlelayer_group by y position and base_collision_layer properties. After this first sort, send_to_front [boolean], sort_function [callable], send_to_back [boolean] and sort_function_end [callable] Phaser.DisplayObject properties are checked in this order.
Calculates whether it's time to start a random battle.
the encounter finding rate of the current battle zone.
returns true if it's time to start a random battle.
Unsets all filters in this map.
Unsets this map.
The map update function.
Updates the new position of an IO or NPC in this map structure.
the old x tile position.
the old y tile position.
the new x tile position.
the new y tile position.
the old collision index.
the new collision index.
the NPC or IO instance.
If it's a world map, rotates the map on hero movement start.
Checks whether it's time to start a random battle.
Generated using TypeDoc
The class reponsible for the maps of the engine.