The Path of the Game Dev — Day 9

Gabrielle Igarta
2 min readDec 3, 2020

Saving progress…

— —

As mentioned in my previous post I was deliberating what to do for an alternate projectile. My first idea was a giant laser beam but I was unsure if it qualified as “projectile”, so I also created a freezing shot! This one, instead of destroying the enemy, would slow down its movement and prevent it from shooting lasers at the player. This would buy the player some time to move around the field to grab an extra power up. Quite useful in situations where the player has low health and ammo and no damage shield.

Weirdly enough, the thruster charge bar I worked on yesterday had an issue where it was not depleting when I held down Left Shift. I investigated further…

And found it was actually because the slider value was constantly increasing per second! Not what I wanted!

I had to go in and fix the method so it would only call RestoreCharge when the Left Shift was not being held down AND that restore could not increase the current value past a maximum of 100. Here’s what it looks like now:

void Update()
{
if (curCharge >= maxCharge)
{
curCharge = maxCharge;
}


if (Input.GetKey(KeyCode.LeftShift))
{
DepleteCharge(0.6f);
}

else
{
RestoreCharge(0.2f);
}

}

(Max charge is 100.) And with that, let’s see where we are with Phase 1.

Thrusters when Left Shift is down? Check.

Shield Strength with 3 hits before disappearing? Check.

Ammo Count to update with each shot, with a max of 15? Check.

Ammo Collectible to restore ammo to full? Check.

Health Collectible to restore 1 health? Check.

Secondary Fire? (oops I did two of them) Check.

Thruster Charge represented in UI and has a cool down? Check.

Camera Shake on damage to player? Check.

A spaceship sits in front of an asteroid on a space background. UI elements for Score, Current/Max Ammo, and Thruster charge.
A scene from the start of the game!

Well then, it looks like Phase 1 is now complete!

But a new challenger awaits.

— —

Progress saved!

--

--