From a space shooter project standpoint, today I accomplished another checklist item towards completing the Core Programming section.

I implemented a “collect” feature for the player that pulls any powerups on screen to the player’s location at an increased rate. Although this took me a few tries, the solution I came up with is relatively straightforward and simple.

I established a Vector3 called _target and a variable for the player’s position called _position. In Update(), _target is updated as _position.x, _position.y, _position.z. Since this is on the powerup script, this keeps the powerup clones “looking” at the player’s position.

The next step was to update the movement method for the powerups. I put the current movement into an else block, and created a new if block. The If evaluation includes GetKey for “C” while also evaluating the y value of the powerup’s position vs. the y value of the player’s position. I decided to evaluate these y-axis values so that if the powerup is lower on the screen than the player, the player can no longer collect that powerup with the “collect / c” key. To move the powerups for when the If evaluation is met, I used transform.position = Vector3.MoveTowards(transform.position, _target, _step); where _step was an increased speed variable multiplied by Time.deltaTime.

At a future point, I may try different methods to achieve this function, such as Lerp, and see if there are advantages or disadvantages with regards to smoothness of travel. I believe I will also add some parameters so that the powerup has to be within a certain distance of the player in order for “C” to work.

Next, I’ll be moving on to controlling spawn waves.

I spent the remainder of the day updating my social media and other various accounts, ensuring that everything is connected to my personal email account (instead of GameDevHQ), in case I lose access to those accounts if the ACI program is not extended.

We’ve still got our fingers crossed, and hopefully with Congress’s recently passed stimulus bill, the State will be able to extend this wonderful, meaningful, talent-building program for its constituents.

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