This week, i am going to write about one of the latest additions to our game Selfish, which is the wave announcement.
One of the things written in our feedback, was that the enemy waves were spawning quite fast and without warning. With that in mind, we decided to make a wave announcement UI, that would pop into the screen right before the enemy wave appeared. While that was seemingfully simple, it turned out to become quite a headache. One of the things that would provide that aformentioned headache, was that i personally had not used a repeating function before. It took a while to actually understand how it works, but it was really going to be needed (now for this specific task and even more for any future tasks), since it needs to be working on repeat as well as have a certain delay on it. After consulting my teamates for the correct use of the previously mentioned function i was able to have some results. While that meant that progress was made, the results were not satisfactory, since the Announcement would linger on the first enemy wave, until you cleared it and the second wave would work normally, while the next ones would not. Apparently, part of the code written by me, would not work in the IEnumerator (which is the aformentioned repeating function).
After spending a bit too much time on it that week, i decided to drop the task as it was, just to be able to pull through with the rest of the tasks given to me. Result of that, was that i had to retake this task for the next week.
Luckily, this week we had our code reviewing with our teacher and i decided it would be a good chance to get another set of eyes on the code. Turns out, that all that needed to be changed for the announcement, was to send it to a gameObject. Basically, after adding one line of code to what had already been written, made it work properly. The only thing that was not resolved, was that on the first wave, the announcement would not go away after a the set time we had. It felt pretty silly to be told to add the function doing that to the starting function of the script, because the solution on that at least was pretty simple.
Well i did learn that i should probably get a fresh set of eyes, because a programmers worst enemy appears to be frustration.