Small Wins

Kristin
3 min readDec 8, 2020

--

After getting help from Daniel, I was able to fix a lot of the bugs that started this weekend. Upon watching the C# Survival Guide CoRoutine Section of the was also able to figure out an IEnumerator Damage Control method to limit how quickly my player damage could accumulate, as my player lives were quickly being drained in one swipe if lasers had freshly instantiated in an enemy- I didn’t want to turn off the enemy laser, it was doing that in the first place that worsened all of my bugs. To do this, I created a boolean _canDamage to true, then set to false after my damage script was called, and then called a IEnumerator DamageControl Method to put a yield return new WaitForSeconds for the amount of time I wanted to wait until the next Damage script could be called.

Lines 271 through 279
Limited damage allowed using a IEnumerator

I also added the explosion sound effect to my left and right engines, so that there would be a sound played when the player was damaged, and I also fixed my enemy lasers (in the laser script) to destroy after calling player damage.

Sound added with player damage animation

As for my thruster scaling bar code- I ended up just deleting all of it because I just can’t figure out how to get it to work…upon watching video after video, scripting api after scripting api…google answer after google answer…even delving into YouTube tutorials and asking for help on Slack….I just can’t seem to get this concept. I’ve had many a brave soul on Slack spend quite a bit of time attempting to explain Get Component to me and… I. Just. Don’t. Get. It. Right. Now… Due to this, it makes the most sense to me to just start over a new, rather than trying to navigate tons of commented out code.

Positive Affirmation: Just because I don’t understand it now, doesn’t mean that I always won’t understand it. This material comes easily to me and I quickly understand it.

I mean…if what I’ve tried so far isn’t working, why not try the law of attraction? I’m choosing to believe that even though it doesn’t make sense now, it will make sense eventually. And that I will understand so well, I will be able to teach it and debug C# unity code like it’s never been debugged before. Until then, I have to keep counting all wins I can.

Stay well friends,

Kristin

Today’s Thank You of the Day goes out to Daniel- thanks for the help!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Kristin
Kristin

Written by Kristin

Astrologer turned Software Developer who is aiming for the stars to land on the moon. Kristin the Developer is the Celestial Sleuth.

No responses yet

Write a response