Day 16 — Core Programming

Today I began digging in to phase two of the completion of my 2D space shooter game. This Core Programming section is comprised of various challenges, each valued at two points for completion, with a certification score requirement of minimum twenty of twenty-eight points. I was able to take a step back today and truly appreciate the scope and progression of my learning in just over three working weeks. It’s a testament to the design of the GameDevHQ program, the teamwork and camaraderie; I’m proud to be an intern.

Okay, that said, on to phase two. To this point, all of the pickups (powerups) for the player had a positive impact. Today I created a negative pickup for the player. This so-called “debuff” token freezes the player in place for five total seconds upon collection. I sourced a decent sprite for the visual, added the necessary components in Unity’s inspector, added the object to the spawn manager’s array of objects, assigned it in Unity, and presto. The debuff code was achieved with an IEnumerator for a frozen effect. Kept it simple, and it worked well. Check that out below:

“stuck” in place by changing the speed variable temporarily

Next up, I augmented the visual representation of the player’s ammunition on screen. The requirement was to visualize the current and maximum ammunition levels. I achieved this with the slider component on the ammo count object, which is on the UI layer of the game. The slider decreases in whole integers, and I supplemented that with a text overlay denoting “Ammo: x/15”. I’d like to go back at a later point and introduce a visual representation where the user has fifteen small lasers at start (full complement), and as the lasers are fired or refilled, the graphic representation changes. Think bullet lineup but lasers instead. I would prefer that setup, although my current one certainly meets the requirement as it’s detailed in the instructions for certification.

bottom left: incremental change to ammo level with text overlay

Thirdly today, I balanced some of the spawning action during game play. Several of the collectables are more frequent (ammo, speed, shield, triple shot, debuff) whereas others are less frequent (heal, super shot). This should make the game more challenging. I achieved this by editing the arrays that store the powerup variable to be chosen by the spawn manager.

I feel comfortable moving forward through phase two. I’ve identified most of what is the lower hanging fruit for me in this section, I’ve begun to tackle it, and I will jump into some of the harder aspects with a full head of steam.

Coding my future as a software developer; // if (attitude > 0) {progress ++;}