summaryrefslogtreecommitdiff
path: root/src/world.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 895eb0f..ad055c0 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -26,9 +26,11 @@ void world_t::generate_tile(tile_t *tile, tile_index_t x)
waterlevel = perlin.get(x, 1000.0f) * 0.3f +
perlin.get(x, 500.0f) * 0.1f;
- height = perlin.get(x, 10.0f) * 0.6f +
- perlin.get(x, 5.0f) * 0.25f +
- perlin.get(x, 3.0f) * 0.2f;
+ height = perlin.get(x, 40.0f) * 0.6f +
+ perlin.get(x, 20.0f) * 0.25f +
+ perlin.get(x, 10.0f) * 0.2f +
+ perlin.get(x, 4.0f) * 0.1f +
+ perlin.get(x, 1.0f) * 0.05f;
if (height < waterlevel - 0.2f)
tile->type = -1;
@@ -41,6 +43,10 @@ void world_t::generate_tile(tile_t *tile, tile_index_t x)
tile->type = 3;
else
tile->type = 2;
+
+ if (height > waterlevel + 0.1f &&
+ perlin.get(x, 2.0f) > 0.3f)
+ tile->type = 4;
}
}
@@ -75,7 +81,8 @@ bool world_t::find_path(v2f_t src, v2f_t dst, rectf_t size,
tile_index_t index;
index = finder.base + tile_index_t(x, y);
- node->accessible = (get_tile(index)->type >= 1);
+ node->accessible = (get_tile(index)->type >= 1 &&
+ get_tile(index)->type <= 3);
}
if (!finder.find())