Day 3 — Video games foster the mindset that allows creativity to grow

Mark Bohuslav
2 min readNov 26, 2020
It’s coming along!!!

Big day overall, I started off strong, breezed through Prototype to Production and then went through all 3 Powerups ( Triple Shot, Shields and Speed Boost). I was able to complete most of the challenges and even jumped ahead on Shields and Speed Boost while I was still in the Triple Shot Module.

While what I did was functional it was not ideal. I had used If, Else for the OnTriggerEnter2d Collisions instead of using Switch statements which is what I learned about afterwards from watching Jon’s execution in the Challenge Review. I should have known this since I watched the Switch Module from the C# Survival Guide the day before! I had also created an INT variable for PowerUpID, used an IEnumerator Coroutine to randomize the value and IF/ELSE statements to determine spawning and instantiation of the respective powerup based on the PowerupID value. Again while functional Jon’s method of using an Array was much cleaner ( less verbose) and more functional since you can see the list of powerups in the Inspector. Arrays are Awesome!

I did have one gripe with the current PowerUp system as implemented. Because of how yield return new WaitForSeconds suspends the Coroutine for the predetermined time, when you collect another PowerUp during this time frame it does not reset the clock. So for example if you collect another identical PowerUp right before the end of the timer, the PowerUP effect will still end when WaitForSeconds completes its count. I spent a little while trying to figure out how to instead reset the timer when an identical powerup is collected during the count but had no luck as of yet to figure out an easy implementation. I didn’t want to get side tracked too much so I decided to skip this concern for later when I am done with the 2D coursework and have time to polish the game elements.

Overall another great day!

--

--