A few small changes so that the player's lightsource is just like any other entity lightsource components.

main
Zed A. Shaw 2 days ago
parent fc61ef42ac
commit 3a16595ca7
  1. 4
      assets/config.json
  2. 1
      assets/enemies.json
  3. 1
      worldbuilder.cpp

@ -6,8 +6,8 @@
},
"worldgen": {
"enemy_probability": 20,
"empty_room_probability": 20,
"enemy_probability": 10,
"empty_room_probability": 60,
"device_probability": 100
}
}

@ -6,6 +6,7 @@
{"type": "Tile", "config": {"chr": "\ua66b"}},
{"type": "Combat", "config": {"hp": 200, "damage": 15}},
{"type": "Motion", "config": {"dx": 0, "dy": 0, "random": false}},
{"type": "LightSource", "config": {"strength": 70, "radius": 2}},
{"type": "EnemyConfig", "config": {"hearing_distance": 5}}
]
},

@ -231,7 +231,6 @@ void WorldBuilder::place_entities(DinkyECS::World &world) {
// configure player in the world
Player player{player_ent};
world.set_the<Player>(player);
world.set<LightSource>(player.entity, {50,1.0});
world.set<Inventory>(player.entity, {5});
randomize_entities(world, config);

Loading…
Cancel
Save