You can now DoubleJump!

This commit is contained in:
verysecrethero
2016-01-29 10:12:49 +01:00
parent 7408da401b
commit 0c97ce7a4a
2 changed files with 9 additions and 1 deletions
+7 -1
View File
@@ -76,7 +76,13 @@ void PlayerMovementSystem::Update(double dt)
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
}
if (controller->Jumping() && !controller->Crouching() && velocity.y == 0.f) {
if (controller->Jumping() && !controller->Crouching() && (velocity.y == 0.f || !m_DoubleJumped)) {
if (velocity.y == 0.f) {
m_DoubleJumped = false;
}
else {
m_DoubleJumped = true;
}
velocity.y += 4.f;
}