Phase1: Thrusters

Bill Rislov
May 28, 2021

Objective: Move the player at an increased rate when the “Left-Shift” key is held down and reset to normal speed when let up.

First, we need to set up some variables. we will need a variable for the current speed, the multiplier for the thruster speed and if the thruster is active or not.

Variables

Next, we need to check for the “Left_Shift” key being held down. If the key is down then we set isThrusterActive to true, otherwise, it is false.

Now that we have the variables set and the check for the “Left_Shift” key, we can call our CalculateSpeed method. If the isThrusterActive is true the speed with be multiplied by the thrustMultiplier.

Ok now let's see how this works. Watch the Current Speed change.

Happy Coding!

--

--