Day 58: Shorthand

Just a little something I found interesting – in VS Code when the quick fix lightbulb suggests to encapsulate a field, it automatically inserts something like this:

public float DebuffDuration { get => debuffDuration; set => debuffDuration = value; }

…instead of the longer code below which was in the tutorial:

public float DebuffDuration
{
     get
     {
           return debuffDuration;
     }

     set
     {
           this.debuffDuration = value;
     }
}

It seems a lot cleaner & easier to read having the accessors all in one line instead of spread over a dozen.

As far as I can tell, they both do the exact same thing as it hasn’t messed up the game or thrown any errors.

I don’t know if that’s what’s referred to an Auto-Implemented Property, expression lambdas or just a shorthand way of typing the same code. Either way, I didn’t realize the same code could be written in different ways.

Between this little realization and what I’ve read thus far in ‘Clean Code’, programming well can be considered an art.

Current Progress Status

  • Tower Defense Tutorial: 56/73
  • Clean Code by Robert C. Martin (pg 185/464)

Onward!

Day 1: 365 Days To A Published Game

I’ve created this devlog as a motivational and accountability tool to keep myself on track.  I’m on the wrong side of my 30’s and in a non-career.  I feel like my life is stuck on pause so I need something to focus on, to create, to move forward.   They say you’re never to old to learn and I’m going to put that adage to the test.

The goal:  to have a game published on Android and/or iOS and/or Steam.  My hope is that a year from now I can look back at the progress I’ve made with pride and perhaps help encourage someone else that finds themselves in a similar position.   The 5-year stretch goal is to become a game developer full-time, either as an indie or part of a studio.

GameSalad, Unity, Unreal Engine, Corona, GameMaker Studio, and Godot are just some of the game engines available

A lot of time has been spent researching which programming engine/language to use.  In the end, I wanted the flexibility to create both 2D and 3D games along with multi-platform developability, so I’ve decided on Unity with C#.    There was plenty of analysis paralysis with this decision.  I just needed to choose something and start programming!

Unity has a lot of tutorials.  But before I jump in with the game engine, I want to lay  down a knowledge base with C#.   The last time I’ve “programmed” anything was over 20 years ago, but the only thing I can actually remember goes even further back – to the days of Apple IIe and BASIC:

10 PRINT "HELLO"
20 GOTO 10
RUN

I remember being fascinated by games like Elite and RoadWar 2000.  My friend had a huge collection of floppy disks (his dad’s) and he would bring them to school for us to play.

Apple IIe
This technological marvel was the pride of my elementary school

Sadly, computers were cost prohibitive back then so I begged my parents for the next best thing: a video game console.  Coleco, Atari, and Intellivision were old news.  There were two new kids on the block.

I stared at that Consumers Distributing catalog for hours, agonizing between the NES and Sega Master System.   The fateful decision made on that day would determine who were my friends and enemies at my elementary school.   Once a side was chosen, I was bound to uphold and vindicate the supremity of that system.  The latest issue of EGM and GamePro would provide fodder for each respective side.

Consumers Distributing ad
The 80’s were a magical time

But I digress. I’ve procrastinated long enough.  It’s time to start on the  journey to become a game developer myself.

I will begin with this free course on Youtube:   C# Tutorial – Full Course for Beginners by Mike Dane.

If you are reading this, feel free to comment and leave your thoughts throughout the journey.

Onward!

Create your website with WordPress.com
Get started
%d bloggers like this: