Day 18: A Series of Unfortunate C# Events

Brittany Lumanlan Martin
2 min readDec 17, 2020

Attempting to implement a wave sequence for my enemies has sent me into a cosmic spiral of endless code revisions and hours of eye-drying code debugging.

At the start of the day, I was set to code the behavior for my new enemy, deemed “Enemy2”. I quickly realized that when I attempted to run the game, Enemy2 would disappear. I figured it was a simple fix, as I had run into this issue before. I toggled the layer order to “foreground” in the sprite renderer, thinking the game object would surface from beneath the background. When that didn’t work, I tried to rotate the object on the x, y, and z axes. Adjusting the z axis brought me close, but Enemy2 was still disappearing when I hit play.

Not wanting to dwell too long on fixing this issue, I made a note to come back to it and tried to move on to creating a balanced spawning system. In this section, the requirements meant making powerups such as ammo more readily available than a powerup like health, seeing as that effect is more coveted and would even out the difficulty of the game. At this point, the code I had previously written for my enemy wave sequence wasn’t working ideally and I figured since I was already working on code for spawning, I would rewrite it. I spent hours on this, and it got nightmarish to say the least. None of the adjustments I made would make my enemy objects spawn in sequential waves.

As of writing this blog entry, I finally have my Enemy2 ship showing up as intended and firing off its weapon, the plasma bomb.

Some days a solution is right under your nose, and you won’t notice it until hours later. So it goes.

I have one last bit of code to write for the behavior of the plasma bomb, and it should be set. I’ll be having another attempt at that wave sequence in the morning.

--

--