Space Shooter Features: Thrusters
Jul 22, 2021
--
Thrusters move the player at an increased speed when the ‘Left Shift’ key is pressed and return the player to normal speed when the ‘Left Shift’ key is released.
Receipt
- Write a condition that checks whether the left Shift key is pressed.
- If the left Shift key is depressed, increase the speed variable.
- Write a condition that checks if the left Shift key is pressed up.
- If the left Shift key is pressed up, set the speed variable to the default value.
Solution
A feature is the “Thrusters” method.