Reduced enemy spawn rate in dungeons, fixed spawning

This commit is contained in:
Joshua Barretto 2020-04-19 18:11:24 +01:00
parent 708f15915a
commit 4dbb6a631f

View File

@ -290,7 +290,7 @@ impl Floor {
self.create_room(Room {
seed: ctx.rng.gen(),
loot_density: 0.00005 + level as f32 * 0.00015,
enemy_density: 0.0005 + level as f32 * 0.00015,
enemy_density: 0.0005 + level as f32 * 0.00005,
area,
});
}
@ -367,7 +367,8 @@ impl Floor {
for y in 0..TILE_SIZE {
let pos = tile_pos * TILE_SIZE + Vec2::new(x, y);
if (pos.x + pos.y * TILE_SIZE * FLOOR_SIZE.x).rem_euclid(room.enemy_density.recip() as i32) == 0 {
let nth_block = pos.x + TILE_SIZE + (pos.y + TILE_SIZE) * TILE_SIZE * FLOOR_SIZE.x;
if nth_block.rem_euclid(room.enemy_density.recip() as i32) == 0 {
// Bad
let entity = EntityInfo::at(
(origin