Galaxy Shooter — Phase I: Framework

Rob George
2 min readApr 28, 2021

Day 31 — Aspiring Game Creator

2D Game Dev: Galaxy Shooter

Demonstrating the CalculateShipSpeed method with various power-ups, thrusters & damage

Objectives: Thrusters

  • 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.
  • Animating ship’s banking along with horizontal movement (Tilt).
  • Afterburner FX/SFX.

Pseudo Code:

  • Fell in love with accidentally FLIPPING the Y Scale in a negative direction so that’s “the look” of the Afterburner burn/flame.
  • Left-Shift key held down: enables Afterburner: Re-Calc speed
  • Left-Shift key up — Re-Calc speed

Galaxy Shooter has always had a CalculateShipSpeed method.

Initially the method was used to lower the ship’s speed when damage occurred — first hit, second hit — then was used when the Speed Boost power-up is activated — a multiplier based on the current speed.

Ship will still get a boost while damaged but not as much as if it were in perfect working order.

Now, when the Afterburner (Main Thruster) is activated the current base speed will have a larger modifier..

Though it’s a bit more complex, the Afterburner is simply a power-up, controlled by the player.

Tomorrow this player power-up will be turned into a temporary boost. The Afterburner will have a finite tank but will be recharged by a Regeneration coroutine only after some time of no use.

But for now, it’s simple, check for LEFT-SHIFT KEY HELD and LEFT-SHIFT KEY UP.

Ultimately, the methods above call to the CalculateShipSpeed method below for the new player speed.

--

--