60 days to become a game developer. Day 31.

Hello! Here is a recap of yesterday, Day 31 of my 60 day challenge to become a Unity Game Developer :)

Today I did a little bit of work on my game but mostly focused on doing Unity game challenges. This gave me an opportunity to work with some of my teammates to try and solve these challenges. Yesterday was a good reminder of what I love about programming. Every idea, every feature, these challenges, they’re all basically just puzzles that need to be solved. The process to get there is engaging and working with my teammates to figure it out was super fun. Working on a good team always makes for an awesome time and its interesting to see how everyone approaches the same problem.

Here was one of the challenges:

Image for post
Image for post

Here is how we approached it:

First we took a look at the game scene and hierarchy to inspect what was provided as our base for the challenge.

Image for post
Image for post
There was also a sphere “red ball” also provided.

After that we could then start to think about what we needed to do. To keep things organized and to ensure that we thought everything through, the first thing we did was write out what needed to be done in pseudocode.

Image for post
Image for post
Some pseudocode written out for our rotator script

Looking at the problem we knew that we would need to create scripts for our rotator, launcher, and ball.

From looking at the challenge we knew that for the launcher script we needed to figure out a way to instantiate the ball, make sure that when the ball is instantiated it does so at a rate of 1 sec, and that it shoots in the direction of the launcher. Here is what we came up with:

One issue we came across was making sure that the ball was instantiating from the launcher at the right point. Luckily, another teammate was able to figure out that by creating a separate transform component we could then set it’s position to the position of the launcher which is what the _ballSpawnPoint transform shown above does.

For the rotator script all we needed to do was set the rotation and create a speed variable to set the speed.

Image for post
Image for post
Vector3.up moves the rotator clockwise on the y axis, Time.deltaTime normalizes the speed.

Here is the ball script:

Image for post
Image for post

This is what moves the ball forward as well as destroys the object 2 seconds after launch.

After recapping this it all seems very simple but to be honest it took a lot of teamwork, some googling, some reviewing past projects in order for us to have solved this challenge. It was very rewarding and look forward to keep working on these challenges both with my teammates as well as on my own.

Challenges:

  • Still a bit behind in my game. Will work on it this weekend and hopefully be all caught up and have it completed by early to mid next week.

Today I will be working on finishing all of the cutscenes for my cinematography game!

See you soon.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store