diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/worldgen.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
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); } } |