You can now DoubleJump!
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user