Skill Tree Activated

The quest to become an indie game developer

#100DaysOfCode#100DaysOfGameDevC#Illogical BaconPanic RoomScript-writingUnityVisual Studio

New Method: GetLabelDigits

#PanicRoom Day 068

#100DaysOfGameDev R2D33
#100DaysOfCode R2D34

Spurred on by yesterday’s rush of creativity in the midst of performing some much-needed code cleanup, I pushed forward getting some long-awaited tasks completed that I didn’t have the heart (or balls) to tackle previously.

I had already used the same block of code twice to determine what numbers my grid label tiles were going to represent and, with another grid overlay system in play, I was planning to use it yet again two more times. This could only mean one thing: time to give it it’s own Method.

Setting up to make the call to the GetLabelDigits Method to be able to determine how each label tile should be made.

Normally, with my skill-level of coding, this is pretty straightforward, but since I am still very much a Code Newbie I encountered the need to do something I hadn’t directly worked with before: return new data back that wasn’t explicitly delivered to the Method. I struggled for a few minutes before discovering my solution and, while simple, it was a bit of a brain-bender to get down. This is probably why I shied away from it so readily on a previous attempt some time ago. But not today! Today was all about overcoming these roadblocks and speedbumps that had been plaguing me and I was determined. It just came down to proper use of the out parameter and proper variable setup going in. Once I had it properly sorted, my Method did exactly what it was supposed to and I was able to reference it multiple times and get what I wanted out of it. This is how I learn, this is how I’ll get better.

Taking a label tile number and breaking it down into place values to be able to then construct it out of its respective sprites.

The rest of my time today was spent making changes to my Floor Grid Labels so it could be distinguished from the House Grid Labels I need to add in and get working independently of everything else. I realized I will need to have two autonomous labeling systems because their needs are going to be different and House Grid has smaller, and more numerous grid squares to work with.

Tasks completed for today. While mainly trivial, they contribute greatly to setting up the next big push on developing this script and, hopefully, completing it.

Leave a Reply

Your email address will not be published. Required fields are marked *