GameDevHQ — Day 9 — The Power-Update


Today’s entry will be much quicker than yesterday’s as I am still in the process of completing two of the four remaining features needed for the Framework build of the game. The two features were the creation and implementation of two new powerups, one to replenish the player’s health and another that gives them a new firing mode.

Creating the health pickup was fairly straight forward as the logic for doing so involved doing the opposite of almost every action taken by the Damage() function in the Player script. This included increasing the player’s life count by one, disabling one of the damage smoke trails on the player’s ship, and updating the UI to match the number of lives left. One fun part of this section was getting to open up photoshop again and make an icon from scratch to represent the powerup.

Custom icon created to represent the powerup that allows players to restore their health on pickup.

In addition to implementing this new powerup there were a few bugs that I caught and fixed such as the player shield improperly updating if they picked up another shield power up while already having an active shield. The issue that occurred was that the amount of hits would be refreshed but the shield visuals would not update to reflect this. The solution just involved adding the lines that call the ShieldColor() function which handles the visuals in the section of the code that activates when the shield powerup is collected.

Currently at the time of this writing I am still working on the second feature which is a new powerup that provides the player with a new firing mode. In this case I felt that I wanted to challenge myself and tried to make a powerup that allows the player to fire lasers that home in on enemies. Since this feature is still not finalized I’ll forgo the finer details this time but the main actions that were done to attempt to achieve this goal were the following:

  • Keep a list of the positional data of all the enemies that are spawned.
  • When a homing laser is fired it will attempt to determine which enemy is the closest and then travel to that target.
  • If the target is destroyed the laser will just fire straight up or select a new target.

Besides the coding portion of this task there were also some challenges on the visual side that led to some leg work to solve them. The first was that I wanted to keep some visual consistency with the triple shot powerup as this was going to be a different firing mode. However due to lacking the time to properly recreate the font for the labels that are on each of the powerup icons I shifted the color of one of the previously existing powerup sprites and modified the text a bit to meet the goals I wanted to achieve. While the finished result is not as polished looking as the sprites we were given for this project I am at least happy that the edits I made meant I could keep some level of the visual consistency that I wanted to convey for the two firing mode powerups.

The modified powerup icon to represent the “Homing Shot” firing mode.

The other challenge that I ran into was in using the default laser sprites colored blue to represent the homing lasers. Due to the homing behavior that this firing mode has I ran into issues where the lasers would not orient themselves properly and instead of pointing at their target would sometimes drift into them and hit the ship with the broadside of their sprite. A fix to further distinguish the homing shots from the regular lasers and hide this rotational issue until a solution is found was to create a custom sprite for the lasers that was disc shaped and uniform looking on all sides.

Custom Homing Laser projectile sprite

As of this writing the issues I am running into and will continue to try and solve is there seems to be a delay in updating the target recognition for the projectiles if they are fired after a potential target has been destroyed. Any projectile that is fired in the period where an enemy is destroyed but a new enemy has not yet spawned will track to the previously destroyed enemy’s last known position and vibrate back and forth. They will continue this behavior until a new object is spawned at which point they will then rocket off in random directions.

A funny side effect of this behavior that I found in testing was that if multiple shots were fired while multiple enemy ships are in play the lasers will target the closest enemy, destroy them, and then orbit that location until a new ship is spawned. Once that occurs their targeting is updated and they will immediately zip over to the next closest ship and destroy it. They will repeat this behavior until all ships are destroyed at which point they will again fly out of bounds of the play area and then be deleted.

Example of the current error where multiple projectiles orbit around the destroyed enemy’s position.

In my research part of the issue is that their targeting is not updating properly to recognize that the last possible target has been destroyed and continues to reference data that has been rendered null when the enemy was destroyed. I currently do not have a clean solution to this but I plan to continue researching this tomorrow and I will keep updating this blog with my progress. Until then, mahalo for reading!

— Kurt




An aspiring game-dev from Hawai’i. Previous experience has been in programming and animation work. Blogging my progress through personal projects and research.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

MVP mlsDev

Jenius Mobile App — a UX Case Study

Energy Generating Surface

AB 101: Historical Figures in Generative Art — A. Michael Noll

No, I´m not a Trendy Designer.

Usability Evaluation and Site Redesign

Miller Gallery Hybrid Exhibit

The Engineering Stakeholder Interview

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kurt Noe

Kurt Noe

An aspiring game-dev from Hawai’i. Previous experience has been in programming and animation work. Blogging my progress through personal projects and research.

More from Medium


Use the Command line to upload larger files on GitHub

Terk - the most popular token in the crypto community, will bring the spring of Meme?

The Files of Sinatra Backend Projects