Enemies can be tagged as moving randomly, but it's very subtle.

This commit is contained in:
Zed A. Shaw 2025-01-09 14:25:34 -05:00
parent 222b39c403
commit d6916b675e
4 changed files with 11 additions and 3 deletions

View file

@ -192,11 +192,15 @@ DinkyECS::Entity place_combatant(DinkyECS::World &world, Map &game_map, std::str
auto enemy = world.entity();
auto enemy_data = config.enemies[name];
world.set<Position>(enemy, {game_map.place_entity(in_room)});
world.set<Motion>(enemy, {0,0});
if(enemy_data.contains("components")) {
components::configure(world, enemy, enemy_data);
}
if(!world.has<Motion>(enemy)) {
world.set<Motion>(enemy, {0,0});
}
return enemy;
}