2018-04-08 01:40:58 -04:00
|
|
|
# Map Spawning
|
|
|
|
|
|
|
|
|
|
Individual sections of the overworld are stored as separate maps under `src/creators/mapLibrary`.
|
2021-09-08 20:38:57 -04:00
|
|
|
Areas register their neighbors by placing an `AreaSpawner` Actor on the border between the two areas:
|
2018-04-08 01:40:58 -04:00
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
|
creation: [
|
2021-09-08 20:38:57 -04:00
|
|
|
{ actor: "AreaSpawner", width: 608, height: 544, map: "Route 1", area: "Land", direction: 0 },
|
2018-04-08 01:40:58 -04:00
|
|
|
// ...
|
|
|
|
|
],
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Once spawned into the game map, that `AreaSpawner` will kill itself and place an `AreaGate` on the border.
|
|
|
|
|
That `AreaGate`, when collided with, sets the active area and starts a new audio theme.
|
|
|
|
|
|
|
|
|
|
## Active Areas
|
|
|
|
|
|
|
|
|
|
`AreaSpawner`'s core logic only has awareness of the originally spawned area.
|
|
|
|
|
Use `FSP.mapScreener.activeArea` to get the currently active area.
|