diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-09-27 11:35:22 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-09-27 11:35:22 -0400 |
commit | 48cd8419bb274345fe386d47843f9aa16910e090 (patch) | |
tree | a0e31b43b0f38d6de8d3879b29563cfee1b19ced /src/systems/movement.cpp | |
parent | 8be1f74e878950cbbac3f05451341fc18892518b (diff) |
lua-scripted wandering
Diffstat (limited to 'src/systems/movement.cpp')
-rw-r--r-- | src/systems/movement.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/systems/movement.cpp b/src/systems/movement.cpp index 7ff9966..4eb574d 100644 --- a/src/systems/movement.cpp +++ b/src/systems/movement.cpp @@ -75,14 +75,16 @@ void MovementSystem::update(entityx::EntityManager &en, entityx::EventManager &e // make the entity wander // TODO initialX and range? if (entity.has_component<Wander>()) { - auto& countdown = entity.component<Wander>()->countdown; + auto vel = entity.component<Wander>()->script(); + direction.x = vel.x; + /*auto& countdown = entity.component<Wander>()->countdown; if (countdown > 0) { countdown--; } else { countdown = 5000 + randGet() % 10 * 100; direction.x = (randGet() % 3 - 1) * 0.004f; - } + }*/ } } }); |