Day 12–11/7/20
Patience, patience, patience. Today was a little slower than normal. I ran into a few problems that took a while to figure out and debug, but after a lot of patience, pacing back and forth trying to talk the code out, and googling, I was able to get the train back on the tracks. It was definitely a very rewarding process to finally get my program functioning how intended.
I was originally aiming to finish about 5 of the core programming tasks, probably a little high of a goal, but I was only able to complete about 3 and a half of those.
The new enemy type and the enemy shield took me far longer than expected. I originally tried to put the new enemy script in the original enemy script. I realized later on that it would be very difficult to implement the different types of shots for each enemy and would probably be much easier to control down the road if I just created a dedicated script for each enemy. So I scrapped everything and started over. I was able to get the enemy instantiated and set up pretty quickly with the random movement functions but where I ran into problems was getting the poison cloud to properly work. At first, I tried to set up the poison cloud with a fire rate cd, but couldn’t seem to get the shot to work other than when originally instantiated. I then decided to go with a Coroutine method and was able to solve this problem. The next problem I encountered was the positioning of my cloud. For some reason, I couldn’t get the positioning lined up properly with the enemy and tried multiple times re-positioning the cloud in the prefab. I decided after several attempts to just hard code the positioning into the script which solved my problems. After the endless debugging, I was finally extremely happy with my new enemy. A whirling disc that expels a cloud of poison every 5 to 7 seconds.
The next problem I ran into was with implementing the shields on my enemy, I kept running into problems with the visualizer. It wasn’t until I put in the shield directly attached to the enemy in the inspector that I was able to get my shield working properly. I was initially, attaching my shield prefab to the inspector but for some reason, it was reacting differently than when using the shield directly attached to my enemy. Anyways, I spent far too long reworking the code and trying to figure out what was happening, until I realized the code wasn't the problem, as it was working as intended.
All-in-all, it was a little bit of a frustrating day, mostly because I knew the problems I had weren’t necessarily tough, but it felt like I was revolving in circles. Figuring it out though was a huge relief and also gratifying.