public void CalculateControls() { run = settings.GetRunVars(); jump = settings.GetJumpVars(); wallSlide = settings.GetWallSlideVars(); energy = settings.GetEnergyVars(); wallRun = settings.GetWallRunVars(); }
public RunVars GetRunVars() { RunVars vars = new RunVars(); vars.baseSpeed = baseSpeed; vars.invBaseSpeed = 1 / baseSpeed; // We are using the exponential function as our base. So we want our acceleration to be // k Speed (1 - |Speed| / Max) // We will hit max acceleration at Max / 2. So we want to solve for // acceleration = k (Max / 2) * .5 = k Max / 4 // Therefore the power of our acceleration and deceleration can be given by // k = (4 acceleration) / Max vars.baseAcceleration = baseSpeed / accelerationTime; vars.skidPower = (4 * maxBaseSkidAcceleration) / baseSpeed; vars.skidSpeed = skidSpeed; vars.skidMaxControl = skidMaxControl; vars.skidMinControl = skidMinControl; vars.stopSkiddingSpeed = stopSkiddingSpeed; return(vars); }