diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-02-15 08:51:42 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-02-15 08:51:42 -0500 |
commit | 4a5d0a99f7c83c9f254cbfb8f41828831f8251db (patch) | |
tree | 26f2c99558586a1efd59640ba67ebccce5d2be46 /src/components.cpp | |
parent | 29876964587eda6e4d4bfc6543ea31efe983cf0a (diff) |
screenshots, arena door
Diffstat (limited to 'src/components.cpp')
-rw-r--r-- | src/components.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components.cpp b/src/components.cpp index 19ba0fb..644d504 100644 --- a/src/components.cpp +++ b/src/components.cpp @@ -53,12 +53,12 @@ void MovementSystem::update(entityx::EntityManager &en, entityx::EventManager &e if (entity.has_component<Aggro>()) { auto ppos = game::engine.getSystem<PlayerSystem>()->getPosition(); if (ppos.x > position.x && ppos.x < position.x + entity.component<Solid>()->width) { - //auto& h = entity.component<Health>()->health; - //if (h > 0) { + auto& h = entity.component<Health>()->health; + if (h > 0) { fight = true; toFight = entity; - // h = 0; - //} + h = 0; + } } else direction.x = (ppos.x > position.x) ? .05 : -.05; } else if (entity.has_component<Wander>()) { |