From 2d0ca20e5f8775960e1e93add81876ed6fa26707 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Mon, 18 Dec 2017 19:46:24 +0000 Subject: Spawn lone spiders instead of most nests. --- src/game/worldgen.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/game/worldgen.cpp') diff --git a/src/game/worldgen.cpp b/src/game/worldgen.cpp index 0bf67ed..f7d4757 100644 --- a/src/game/worldgen.cpp +++ b/src/game/worldgen.cpp @@ -4,7 +4,7 @@ namespace game { using namespace world; -void add_decoration(world_t *world, state_t *game, v2f_t x) +static void add_entity(world_t *world, state_t *game, v2f_t x) { float noise; deco_t *deco; @@ -21,10 +21,14 @@ void add_decoration(world_t *world, state_t *game, v2f_t x) offset[1] = world->perlin.get(x, 0.19571f); center = x + v2f_t(0.5f, 0.5f) + offset.norm() * 0.1; - if (noise > 0.39) { + if (noise > 0.42) { unit_nest_t *nest = new unit_nest_t(game); nest->place(world, center); return; + } else if (noise > 0.39) { + unit_spider_t *spider = new unit_spider_t(game); + spider->place(world, center); + return; } if (noise > 0.36) @@ -94,7 +98,7 @@ decos: x = v2f_t(index) * SECTOR_SIZE + v2f_t(lx, ly); if (tile->type == TILE_DIRT) - add_decoration(world, game, x); + add_entity(world, game, x); } } -- cgit