Seeking Heat

Samson Malani
4 min readDec 3, 2020

Day 24 on my Journey of becoming a Gaming Software Engineer:

I started off this morning on a mission! I’m currently at 75% completion of my Phase 1 Framework Coursework and want to push to completion ASAP. Sure, many others are far ahead of me, and some started way after me, but surprisingly I’m not struggling alone. There are others who have faced real challenges once the training wheels came off (the guided tutorials ended). It has to come off someday though. How else will we ever learn?

I come from a background of Entrepreneurship, Music, Youth Mentorship, and some tech, mostly in the field of Web Development. I’m pretty much self taught. That’s primarily why I appreciate our GameDevHQ course so much. Jonathon Weinberger does a fine job of training all who have entered into the Aloha Connects Innovation program. It reminds me of self-teaching and going through things at your own pace but being consistent about it. It’s a great program and honestly, the state of Hawaii officials who started it should have created a program like this 15 years ago. I’m glad at least it’s alive today.

Anyway, my mission this morning started with me having to create a Secondary Weapon System. I already had a Laser and a Triple-Shot Laser that I created during the Tutorial section of my coursework. Why not create something different? I did contemplate on making another Laser since that would have been the laziest and easiest thing I could have done. Just copy and paste. Maybe add a little glow to it and change it to a different color, like neon blue lol. Maybe even add a larger explosion during impact. But I didn’t want that. I wanted to create something brand new. So I did.

I started by finding a nice image that I could use both as a Sprite and as the collectable Powerup needed to gain the ability to use my new weapon. I decided that I wanted to create a Heat Seeking Projectile. I searched Google for a nice 2D missile and settled on a cool looking rocket that sorta looks like a rocket booster from NASA. I brought it into my folder and proceeded to make the weapon come to life. I stretched it out a little to make a nice looking collectable Powerup and I sized it just right as an actual Projectile, so when it fires, it would look clean and cool! After creating the Powerup and the projectile and adding the necessary physics components like RigidBody2D and Box Colliders, I dragged both objects into my Prefabs folder and began scripting.

For my collectable Powerup, it didn’t function any different than the Powerups I previously posted about. It was just that it had to be placed in the right areas since it worked similar to my Laser and my Triple-Shot Laser the way it destroyed enemy objects.

For my weapon to function like a Heat Seeking Projectile, it took a lot of thinking, doing, trial, and error. I have a saying where if you’re going to fail, then FAIL FORWARD! I was pleased with all these past days of C# learning, reading, digesting, trying to understand, and typing out code and ALL it had taught me. I was able to Fail Forward on this weapon build quite quickly.

I used a Cross function that Unity allows, which is more easier for me to understand since it helps to navigate objects between an X and a Y axis in a 2D field. I guess I could’ve used a function that I found out later a lot of my teammates had used which is called, Vector Forward and would’ve made my life much simpler lol, but I was on a roll and my weapon worked good. I won’t bore anyone with the code, but I used Between-Script-Communication again and I’m thinking, I might be one of the only learners here that actually understands how to use that method of doing things. My teammates don’t use it much, but it’s easier for me to do things the communicative way than the “easier way” of just hard coding some if statements together. I actually have a harder time understanding it that other way lol. Hey, whatever works, right? I just have to learn later how to make everything not as expensive in code. That time will come! I’m sure of it! Anyway, enjoy the pics!

Till my next post.. Take Care and Aloha Forward,

Sam

--

--