DoubleJumping now in InputController instead.
This commit is contained in:
@@ -76,12 +76,12 @@ 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 || !m_DoubleJumped)) {
|
||||
if (controller->Jumping() && !controller->Crouching() && (velocity.y == 0.f || !controller->DoubleJumping())) {
|
||||
if (velocity.y == 0.f) {
|
||||
m_DoubleJumped = false;
|
||||
controller->SetDoubleJumping(false);
|
||||
}
|
||||
else {
|
||||
m_DoubleJumped = true;
|
||||
controller->SetDoubleJumping(true);
|
||||
}
|
||||
velocity.y += 4.f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user