Lynda.com: Become a Unity 2D Developer (Day 3)

Today, my goal was to complete the 2D Building an Adventure Game lessons, specifically Interactive Objects, Alien and AI, and Managing Scenes.  Once I complete these lessons, I will immediately move towards the next set of tutorials until the entire track has been completed.  From there, I will rework the initial Lynda.com build and then re-skin and rework the mechanics of the game.  Possible add a short story and animations to make the prototype pop a bit more.  Well, no need to go into details yet.  For now, on to the lessons!


INTERACTIVE OBJECTS

Collectible Objects

The Interactive Objects tutorial has been quite enlightening.  I was able to both cause a problem and resolve it due to my prior experiences.  Ultimately, when testing the collectible script, I noticed that the crystal item was not rendering.  On further examination, I realized that the item indeed had rendered, but was placed on the wrong layer.  Once I placed both the player (Astronaut) and the crystal item onto the same layer, collecting the item was a success.


Random Sprite

The Random Sprite exercise was a great tutorial for C# and Unity.  I was able to duplicate numerous instances of the crystal item and then apply the RandomSprite script in order to randomize the type of crystal per game load.  See the different loaded crystal variants on the screen.  Each game load instance has a different set of crystals entirely.


In addition to randomizing all items, I am now also able to set static values to set items and randomize the rest.  This was accomplished by editing the RandomSprite script to include an array variable to represent any given crystal.  From there, it would read the initial value and will determine whether to randomize it's value or keep it static as specified within the Inspector palette.  Notice that the first crystal is consistently a blue hue while the rest change.


Deadly Obstacles

Like the script based lessons before, this lesson is focused on creating a custom script to remove the player once it comes into contact with a "deadly obstacle".  For this exercise, I was able to successfully showcase the most simplified method of displaying a deadly mechanic.  There is a set of spikes that have been arbitrarily placed on to the game level.  In order to properly test out the spikes, I had to have the player fly directly into the spikes.  Needless to say, the Astronaut disappears as expected and the camera comes to a halt.


Debris Disappearing

C# scripting is coming along rather nicely.  Granted, they are composed of short code, but efficient nonetheless.  For this exercise, I was able to set animation values for the Debris game objects, specifically to fade after a few seconds of the initial render.




Spawn Debris

This exercise was very entertaining, specifically the result.  Ultimately, I created another custom script for the Debris and placed it into the Explode Script component.  Now, whenever the Astronaut flies into the spikes, he explodes into countless pieces.





ALIENS THAT WALK

Walking Aliens

Now that the Astronaut protagonist is somewhat functioning, it is safe to assume that the next step was to create enemies.  For this astronaut themed demo/lesson, the enemy added will be an alien.  This lesson pretty much mimicked what I had to do for the astronaut.  After setting up the initial game object/animation, it was a matter of associating the MoveFoward script.  At this time, the alien will walk towards the right, but continuously collides with the wall.  Notice that the astronaut will jump on top of the alien, which has absolutely no impact on the alien enemy.




Turnaround at Walls

The alien enemy has been established, but needs more information in regards to movement.  This next exercise will focus on programming the instructions in which the alien will automatically turnaround once it nears with the wall.


Keep Aliens on Platform

The alien is now able to walk right-to-left and turns around automatically once it nears the walls.  The next scripting example will take that same concept and apply it to a ledge without walls.  Ideally, once the alien comes to the edge, it will automatically stop and turn around.  This process recycles from edge to edge, indefinitely.


 


MANAGING SCENES

Create a Splash Screen

This tutorial was not very challenging.  Most of it was a process of labeling and importing assets.  Although I know that this is a very important step, it is not as exciting than the prior lessons.  Nevertheless, see the screenshot below.  As stated, it was a process of importing assets, which is why it lacks any interactivity or animation(s).


Animate the Splash Screen

Animation is always exciting because bringing the imagination to life is quite satisfying.  The overall aesthetic is quite simple and subtle.  The astronaut not only shows rocket propulsion, but floating in the air as well.  The blinking Start text and the floating animation were all executed through multiple C# scripts.





Switching Between Scenes

The final stage of building the prototype is connecting all of the scenes, specifically from beginning to end.  In this case, the beginning and end scenes are merely starting the game and getting straight into the action.  




Final Thoughts

Normally, this sort of tutorial only requires one day worth of work and time.  However, now that I'm blogging the entire experience, it has definitely made the learning process a bit more taxing, specifically on time.   Overall, I have learned a great deal and will continue the track on becoming a Unity 2D Developer, at least by (initial) Lynda.com standards.  I'm very exciting learning more about C# and Unity.  


Comments

  1. Ahh I love this! It's amazing and I'm super impressed! Not like impressed because you couldn't do it -- think more like impressed because I knew you could and you've (queue echo) FULFILLED (filled-filled-filled) YOUR DESTINY (ny-ny-ny)! LOVE IT!

    ReplyDelete
    Replies
    1. Thank you. I'll eventually upload the prototypes, regardless of how buggy they maybe. I'm in the process of sorting that out.

      Delete

Post a Comment

Popular posts from this blog

JavaScript 30: JavaScript Drum Kit

Lynda.com: Become a Unity 2D Developer (Day 11..Sort of)

Back On the Coding Horse