Well this one’s going to be a short one.

Following a run through of last week’s research we were set to work looking at some code which Ant had made as an addition to the spaceship game we all made early on in the course.

autofireprojectile

autofire2

Our take was to look at the code and do five things,

  1. List all of the variables created
  2. Explain the data type of each
  3. List the functions declared
  4. List the functions called
  5. Explain the use of conditional

Literally no idea. Stared at the screen for 20 minutes. May as well have been written in Klingon. Loaded up a previous tutorial from very early on to find out/remind myself what a variable is. Immense relief when the class went through the answers and as ever, I didn’t look at Ant for fear of being asked.

So, what I got was;

  1. Rotation Speed & Game Object
  2. Game Object = any object can be stored, data type of degrees – float.
  3. Shoot (), Rotate(), Update() [Functions have brackets after them where instructions are written.]
  4. Instantiate = first function in Unity created an instance of something. i.e., Input.GetAxis
  5. Firing of bullets when a certain key is pressed. Also makes firing happen in the direction the ship is facing.

Five is the only one I pretty much understood and I’m fairly sure I’ve gotten mixed up with the others. When Ant marks sees the blogs I’ll know.

We also had an explanation of what this code does with a visual description too.

spaceship-fire

Also increasing or decreasing the number of shots (lower image) and rotation speed (top image) obviously altered how to upper right ship fired, less shots to more shots.

Within our groups for the trio game, we also looked at more code for next lesson where more waypoints and line of sight code will be used – and as ever I’ll remain clueless and probably sit there and stress myself out.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s