diff options
Diffstat (limited to 'battles/src/Battle.cpp')
-rw-r--r-- | battles/src/Battle.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/battles/src/Battle.cpp b/battles/src/Battle.cpp index a28cdc6..7040dd0 100644 --- a/battles/src/Battle.cpp +++ b/battles/src/Battle.cpp @@ -1,5 +1,6 @@ #include <kurator/battles/Battle.h> +#include <cmath> #include <memory> #include <random> @@ -56,9 +57,11 @@ BaseBattle::registry() void BaseBattle::update(const float dt) { - auto view = _registry.view<Transform, Team>(); - for (auto&& [entity, transform, team] : view.each()) - transform.position.x += 0.1 * dt * (team.id * 2 - 1); + auto view = _registry.view<Transform>(); + for (auto&& [entity, transform] : view.each()) { + transform.position.x += 0.1 * dt * std::cos(transform.angle); + transform.position.y += 0.1 * dt * std::sin(transform.angle); + } } |