Revise terrain targetting
This commit is contained in:
parent
3ee5ae3d8f
commit
46827f3428
1 changed files with 11 additions and 13 deletions
24
island.ts
24
island.ts
|
@ -164,22 +164,20 @@ export function IslandApplet() {
|
|||
}
|
||||
|
||||
function tick() {
|
||||
const islandTiles = islands.floodSearch(basePos, (tile) => tile > 0);
|
||||
dropWithin(islandTiles);
|
||||
const lowlandTiles = islands.floodSearch(basePos + 12, (tile) => tile > 0);
|
||||
|
||||
// focus shore
|
||||
dropWithin(islandTiles.filter((pos) => islands.data[pos] == 0));
|
||||
// grow shore
|
||||
const shoreTiles = lowlandTiles.filter((pos) => islands.data[pos] == 0);
|
||||
dropWithin(shoreTiles);
|
||||
dropWithin(shoreTiles);
|
||||
|
||||
// form forest
|
||||
const hill = islands
|
||||
.floodSearch(basePos + 12, (tile) => tile >= 2)
|
||||
.filter((pos) => islands.data[pos] == 2);
|
||||
dropWithin(hill);
|
||||
// seed beach
|
||||
const beachTiles = lowlandTiles.filter((pos) => islands.data[pos] == 1);
|
||||
dropWithin(beachTiles);
|
||||
|
||||
// grow forest
|
||||
const forestTiles = islandTiles.filter(
|
||||
(pos) => islands.data[pos] >= 2 && islands.data[pos] <= 3
|
||||
);
|
||||
// expand forest
|
||||
const forestTiles = lowlandTiles.filter((pos) => islands.data[pos] == 2);
|
||||
dropWithin(forestTiles);
|
||||
dropWithin(forestTiles);
|
||||
dropWithin(forestTiles);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue