You've already forked FullScreenPokemon
mirror of
https://github.com/FullScreenShenanigans/FullScreenPokemon.git
synced 2026-04-28 12:58:40 -07:00
379660458b
* Generalized wild Pokemon encounters to caves (walking) and surfing (water) Uses `AreaGate`s to mark an `activeArea` on the game's `MapScreenr`. No longer needed to keep track of map & area from spawned Things. * Merge branc h'master' * Missing semicolon
20 lines
719 B
Markdown
20 lines
719 B
Markdown
# Map Spawning
|
|
|
|
Individual sections of the overworld are stored as separate maps under `src/creators/mapLibrary`.
|
|
Areas register their neighbors by placing an `AreaSpawner` Thing on the border between the two areas:
|
|
|
|
```typescript
|
|
creation: [
|
|
{ thing: "AreaSpawner", width: 608, height: 544, map: "Route 1", area: "Land", direction: 0 },
|
|
// ...
|
|
],
|
|
```
|
|
|
|
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.
|