Changed SprintAbility to take StrengthOfEffect. PlayerMovementSystem: if Sniper is sprinting he will now move faster.
This commit is contained in:
@@ -58,7 +58,14 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
playerMovementSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||
playerCrouchSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||
}
|
||||
|
||||
bool sniperSprinting = false;
|
||||
if (player.HasComponent("SprintAbility")) {
|
||||
if (controller->SniperSprintingCheck()) {
|
||||
playerMovementSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||
playerCrouchSpeed *= (double)player["SprintAbility"]["StrengthOfEffect"];
|
||||
sniperSprinting = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.HasComponent("Physics")) {
|
||||
ComponentWrapper cPhysics = player["Physics"];
|
||||
@@ -114,6 +121,9 @@ void PlayerMovementSystem::updateMovementControllers(double dt)
|
||||
if (playerBoostAssaultEntity.Valid()) {
|
||||
accelerationSpeed *= (double)playerBoostAssaultEntity["BoostAssault"]["StrengthOfEffect"];
|
||||
}
|
||||
if (sniperSprinting) {
|
||||
accelerationSpeed *= (double)player["SprintAbility"]["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