added death animation through a callback onDeath

This commit is contained in:
HENRY Benjamin
2021-06-03 14:58:03 +02:00
parent 45ee02e06b
commit 378ba98050
5 changed files with 23 additions and 26 deletions
@@ -18,6 +18,12 @@ namespace BBM
_healthPoint(healthPoint)
{}
HealthComponent::HealthComponent(WAL::Entity &entity, unsigned int healthPoint, std::function<void (WAL::Entity &)> callback)
: WAL::Component(entity),
_healthPoint(healthPoint),
onDeath(callback)
{}
WAL::Component *HealthComponent::clone(WAL::Entity &entity) const
{
return new HealthComponent(entity);