using Vector2.angle()

This commit is contained in:
HENRY Benjamin
2021-06-07 16:41:11 +02:00
52 changed files with 972 additions and 494 deletions

View File

@@ -11,15 +11,13 @@
namespace BBM
{
HealthSystem::HealthSystem()
: WAL::System({
typeid(HealthComponent)
})
HealthSystem::HealthSystem(WAL::Wal &wal)
: System(wal)
{}
void HealthSystem::onFixedUpdate(WAL::Entity &entity)
void HealthSystem::onFixedUpdate(WAL::ViewEntity<HealthComponent> &entity)
{
auto &health = entity.getComponent<HealthComponent>();
auto &health = entity.get<HealthComponent>();
if (health.getHealthPoint() == 0) {
health.onDeath(entity);