new TilemapWalker(game, map, layer, x, y) → {Phaser.Plugin.TilemapWalker}
Creates an object that is placed within a layer of a Phaser.Tilemap and can be moved around and rotated using the direction commands.
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
game |
Phaser.Game | Game reference to the currently running game. |
|
map |
Phaser.Tilemap | A reference to the Tilemap this TilemapWalker belongs to. |
|
layer |
number | string | Phaser.TilemapLayer |
<optional> |
The layer to operate on. If not given will default to this.currentLayer. |
x |
number | X position of the top left of the area to copy (given in tiles, not pixels) |
|
y |
number | Y position of the top left of the area to copy (given in tiles, not pixels) |
Returns:
Members
-
collides :boolean
-
Does the TilemapWalker collide with the tiles in the map set for collision? If so it cannot move through them.
- Default Value:
- true
- Source - out/plugins/TilemapWalker/TilemapWalker.js, line 51
-
facing :number
-
The direction the location marker is facing. You can rotate it using the turn and face methods.
-
game :Phaser.Game
-
A reference to the currently running Game.
-
history :array
-
An array containing a history of movements through the map.
-
location :Phaser.Point
-
The current marker location. You can move the marker with the movement methods.
-
locationLayer :number
-
The current layer of the location marker.
-
map :Phaser.Tilemap
-
A reference to the Tilemap this TilemapWalker belongs to.