Day 10: The Enemy Strikes Back
I’m 98% completed with the 2D Game Development course! Today I started off with the “Deployment (Build Your Game)” section, a three-part walkthrough where I learned how to prepare my game for Mac, PC, Linux, and Web GL.
Testing my game out in a fullscreen window felt amazing. All the work that goes into coding movement, actions, audio— to see it all come together was incredibly rewarding. This time two weeks ago, on the day of my onboarding, I was quite intimidated by the thought of learning C# and how to navigate Unity. In fact, I wasn’t sure if I would make it this far into the course. There’s a long road ahead and I still have so much more to learn to become a fully realized software developer, but I’m extremely proud of myself for persevering.
Next, I made it to the “Galaxy Shooter Extras” section, with tips and challenges to refine the look and feel of the space shooter. The toughest challenge for me was programming the enemy ships to return fire at the player. At first, the enemy lasers would fire and freeze in the middle of the screen. When I resolved that bug, I somehow scrambled the code for the player’s laser along the way and it wouldn’t fire at all. When I can’t seem to straighten out a bug on my own, utilizing the Unity Scripting API and searching their forums is always a huge help — which is exactly what I did here. It turns out that a tricky line of code I had problems with a few blogs back reared its head again. Destroy(this.gameObject); was the culprit, this time destroying the lasers for the player every time I hit the space key. I’ve learned that it’s so important to pay attention to details such as these, because one line of misplaced code within the wrong curly brackets can get you stuck in a deep space catastrophe for an hour or two.
I’ve now moved on to Phase I of the 2D course, a true test of the skills I’ve learned. This section consists of a checklist of tasks to complete without the assistance of educational videos from previous sections. My first task has been completed and I’ll be researching the others over the weekend!