From Photographer to Video Game Creator - Day 1

Myles Marion
3 min readDec 1, 2020

--

I’ve spent the past decade of my life constantly playing with my cameras and chasing the next adventure. My mind is always spinning and new ideas are what excite me. With that being said, a new opportunity has entered my sights. Coding.

I have, well, approximately ZERO experience with coding except for the fact that I’m obsessed with all things related to video games. For me it has always been a way to clear my mind and tease my competitive spirit. Even if it’s just for a couple of hours. At first, I laughed at the idea of learning to code, but then, I thought “What the heck, what do I have to loose?!”

So here we are, DAY 1 of my adventure of learning to code. My mission: to create my first video game. Here we go!

Today, I spent some time learning the layout of Unity (our game developing software) and completing a few simple tasks that required my first experience of writing C# code. Here is a look at my first cube:

I know, it’s pretty impressive. I then familiarized myself with the Hierarchy tab which contained the “Main Camera”, “Directional Light”, and my “Player” being the cube. I also learned how to color objects and add it to the materials folder.

So far, so good, right??? Seems easy enough. But now, the intimidating C# code looming in the background has entered the chat…

Alright, it doesn’t quite look like this, but this is what it feels like when you look at your first code. My first task was to create a player script that would reset the object to a specific location, or Vector3. This Vector3 defines all position types (x, y, and z axis) and is entered in Unity as “new Vector3”. To start the script I made sure that my public class was “Player” and it was linked to “MonoBehaviour” Here are my first few lines of code. Get ready, it’s pretty impressive!

Alright, it’s not that much, but I was stoked on it! Running the script reset my cube (or my player) back to the new Vector at (0, 0, 0) on the x, y, and z axis.

Next up was the introduction of variables. Each variable has 3 required components and an optional 4th. Here’s a quick rundown:

  • Each variable must be either public or private
  • A data type is to be specified; Integer, Float, Boolean, or String
  • Every variable must have a name
  • A value can be assigned (optional)

Using these guidelines, I was able to make my player move left and right along the x axis by using the arrow keys. The next part was my favorite. CHALLENGE TIME. We had the lesson and notes on how to move the player left and right, now it was up to me to figure out how to make it move up and down along the y axis. After a little trial and error, I was able to complete the challenge. Here is my final code:

There are many ways to condense code and I learned that each coder eventually develops a style unique to them. Pretty cool! Well, that’s it for my first day of coding. Let’s hope I can remember some of this for day 2!

Later!

-Myles M.

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

--

--

Myles Marion
Myles Marion

Written by Myles Marion

Professional photographer on a journey to create my first video game!

No responses yet

Write a response