#8 | (WIP) Blaster System


Hello!

I've made some significant progress on the blaster system since the last devlog.

Previously, when the player would reload their blaster, they had only one "magazine" that would be refilled from an ammo pool, instead of actually changing out their current magazine for a different one.

I've improved that mechanic. Now, the player will actually swap out their current magazine for a different one, for whichever one has the most ammo.

Now, let's take a look at the code behind this mechanic. I've left extensive comments to explain what each line of code does.

When the player reloads, the game first waits a few seconds (reload delay) before checking which magazine in the player's inventory has the most ammo. Then, if the player already has a magazine equipped, that one is moved back to the inventory. Finally, the magazine with the most ammo is removed from the inventory and equipped.

I've learned a lot from working on this mechanic and the Blaster System as a whole. The next things I'll be working on is an overhaul of the GDD and more components of the Blaster System.

Thanks for reading!

Get HvZ - 2D

Leave a comment

Log in with itch.io to leave a comment.