After the weekend, I took a look with fresh eyes at my code first thing 8am this morning. I took another look at what I wrote for the Thrusters: Scaling Bar HUD requirement. The logic I previously used a for loop in the array of data for player damage (i.e. one hit-> left thruster damage, two hits -> right thruster damage, etc). Upon looking this morning, I realized that although the conditions were logical for me doing this, I didn’t have the right data type set- I had those functions set in a series of if statements. I needed to convert that info to an array first.
Next, I decided that the sections I would focus on today would be Ammo Count, Ammo Collectible and Health Collectible. The collectible requirements sound like powerups, so it made sense to set those up together. The ammo count and collectible are also connected, so I figured I could start to link some of that as well since the ammo collectible affected the ammo count in a similar way the health collectible affects the lives count- thus, if any code needs to be optimized in the future, it makes sense to me at this point that they will be optimized in similar ways.

Throughout the day I kept getting flashes of insight that there were better ways to code that would probably take up less memory. For example, I decided to utilize the player script’s damage code switch statement to control shield strength- lots of mental back and forth for me. I had to tell myself that although these ideas are great, I need to set them aside for now and focus on one set of code at a time so it won’t slow me down (after all, I’m not even sure if some of these ideas will even work in the first place). I wonder how professional coders handle their ideas🤔.
Stay well friends,
Kristin