46-Player Thruster & Thruster HUD
Published in
1 min readMay 9, 2021
In this post, two extra features related to player thruster (speed control and visualization) will be implemented.
The first feature is: move the player at an increased rate when
the ‘Left Shift’ key is pressed down; reset back to normal speed when the ‘Left Shift’ key is released
// if “Left Shift”
// Accelerate, speed = current speed+acceleration * time
// else
// Decelerate, speed = current speed-acceleration * time
The second feature is: create a UI element to visualize the charge element of the player’s thrusters; a cool down system is required.
- create the HUD (heads-up display)
- associate the HUD appearance to speed increase when holding the left shift key, as well as speed decrease after releasing the left shift key
- The left shift function cannot be used continuously. Once the left shift is released, the player has to wait a bit to use another thrusting (the cool down system).