diff --git a/ECS/Systems/KeyboardMovementSystem.h b/ECS/Systems/KeyboardMovementSystem.h index 729201d..9b87408 100644 --- a/ECS/Systems/KeyboardMovementSystem.h +++ b/ECS/Systems/KeyboardMovementSystem.h @@ -28,33 +28,33 @@ class KeyboardMovementSystem : public EntitySystem, public EventSubscribereach([&](Entity *ent, ComponentHandle movement) { if (event.action == GLFW_PRESS) { - movement->moving.z = -1; + movement->moving.z -= 1; } else if (event.action == GLFW_RELEASE) { - movement->moving.z = 0; + movement->moving.z += 1; } }); } else if (event.key == GLFW_KEY_S) { myWorld->each([&](Entity *ent, ComponentHandle movement) { if (event.action == GLFW_PRESS) { - movement->moving.z = 1; + movement->moving.z += 1; } else if (event.action == GLFW_RELEASE) { - movement->moving.z = 0; + movement->moving.z -= 1; } }); } else if (event.key == GLFW_KEY_A) { myWorld->each([&](Entity *ent, ComponentHandle movement) { if (event.action == GLFW_PRESS) { - movement->moving.x = -1; + movement->moving.x -= 1; } else if (event.action == GLFW_RELEASE) { - movement->moving.x = 0; + movement->moving.x += 1; } }); } else if (event.key == GLFW_KEY_D) { myWorld->each([&](Entity *ent, ComponentHandle movement) { if (event.action == GLFW_PRESS) { - movement->moving.x = 1; + movement->moving.x += 1; } else if (event.action == GLFW_RELEASE) { - movement->moving.x = 0; + movement->moving.x -= 1; } }); }