Space Shooter Features: Thrusters

--

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

  1. Write a condition that checks whether the left Shift key is pressed.
  2. If the left Shift key is depressed, increase the speed variable.
  3. Write a condition that checks if the left Shift key is pressed up.
  4. If the left Shift key is pressed up, set the speed variable to the default value.

Solution

A feature is the “Thrusters” method.

--

--

Damian Dąbrowski

Hi, I’m Damian, a Software Engineer who loves building educational apps and simulations..