get overworld map in direction
Problem it solves
You want to check the layout of the adjacent room before unlocking a door to make sure a room actually exists there.
What this block does
Returns the tilemap data of the neighbor room in the specified direction from the current room.
The block
Block ID: overworld_getMapInDirection
Parameters
| Name | Type | Default | Meaning |
|---|---|---|---|
| direction | CollisionDirection | — | The direction of the adjacent room (Top, Right, Bottom, or Left). |
Returns
tiles.TileMapData — The adjacent tilemap data, or undefined if outside the grid.
Example
let northMap = overworld.getMapInDirection(CollisionDirection.Top)
if (northMap) {
game.splash("Path north is open!")
}Add the extension
Add github:riknoll/arcade-overworld to your project, or open: Import arcade-overworld.