From 3ee5ae3d8f749b0e9dab190009d311d13082fa43 Mon Sep 17 00:00:00 2001 From: Tangent Wantwight Date: Fri, 12 Jan 2024 23:58:22 -0500 Subject: [PATCH] Experiment with targeted dropping --- island.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/island.ts b/island.ts index 8a63a9e..8b92343 100644 --- a/island.ts +++ b/island.ts @@ -166,9 +166,25 @@ export function IslandApplet() { function tick() { const islandTiles = islands.floodSearch(basePos, (tile) => tile > 0); dropWithin(islandTiles); - dropWithin(islandTiles); - const mountainTiles = islands.floodSearch(basePos - 8, (tile) => tile > 4); + // focus shore + dropWithin(islandTiles.filter((pos) => islands.data[pos] == 0)); + + // form forest + const hill = islands + .floodSearch(basePos + 12, (tile) => tile >= 2) + .filter((pos) => islands.data[pos] == 2); + dropWithin(hill); + + // grow forest + const forestTiles = islandTiles.filter( + (pos) => islands.data[pos] >= 2 && islands.data[pos] <= 3 + ); + dropWithin(forestTiles); + dropWithin(forestTiles); + + // form mountain + const mountainTiles = islands.floodSearch(basePos - 12, (tile) => tile > 4); dropWithin(mountainTiles); // const erodePos = islandTiles[islands.rng() % islandTiles.length];