Basic simple animations where the enemies just move forward.

This commit is contained in:
Zed A. Shaw 2025-02-22 01:36:31 -05:00
parent 947ccbe180
commit 80a0f2ba75
9 changed files with 92 additions and 80 deletions

View file

@ -131,6 +131,7 @@ void System::death(GameLevel &level, components::ComponentMap& components) {
world.remove<Motion>(ent);
world.remove<Combat>(ent);
world.remove<EnemyConfig>(ent);
world.remove<Animation>(ent);
auto entity_data = config.items["GRAVE_STONE"];
components::configure_entity(components, world, ent, entity_data["components"]);
@ -161,6 +162,11 @@ void System::combat(GameLevel &level) {
enemy_combat.attack(player_combat)
};
if(world.has<Animation>(entity)) {
auto& animation = world.get<Animation>(entity);
animation.current = 0;
}
world.send<Events::GUI>(Events::GUI::COMBAT, entity, result);
}
}