playerMovementSpeed,playerCrouchSpeed in the player component now also gets AssaultBoosted.
This commit is contained in:
@@ -53,6 +53,11 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
float playerMovementSpeed = player["Player"]["MovementSpeed"];
|
||||
float playerCrouchSpeed = player["Player"]["CrouchSpeed"];
|
||||
glm::vec3& wishDirection = player["Player"]["CurrentWishDirection"];
|
||||
if (player.HasComponent("BoostAssault")) {
|
||||
playerMovementSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"];
|
||||
playerCrouchSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"];
|
||||
}
|
||||
|
||||
|
||||
if (player.HasComponent("Physics")) {
|
||||
ComponentWrapper cPhysics = player["Physics"];
|
||||
@@ -104,9 +109,10 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
//if doubleTapped do Assault Dash - but only boost maximum 50.0f
|
||||
float doubleTapDashBoost = controller->AssaultDashDoubleTapped() ? 40.0f : 1.0f;
|
||||
accelerationSpeed = glm::min(doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed), 50.0f);
|
||||
accelerationSpeed = doubleTapDashBoost*glm::min(accelerationSpeed, addSpeed);
|
||||
//if player has Boost from an Assault class, accelerate the player faster
|
||||
if (player.HasComponent("BoostAssault")) {
|
||||
accelerationSpeed *= (double) player["BoostAssault"]["StrengthOfEffect"];
|
||||
accelerationSpeed *= (double)player["BoostAssault"]["StrengthOfEffect"];
|
||||
}
|
||||
velocity += accelerationSpeed * wishDirection;
|
||||
ImGui::Text("velocity: (%f, %f, %f) |%f|", velocity.x, velocity.y, velocity.z, glm::length(velocity));
|
||||
|
||||
Reference in New Issue
Block a user