8/21/11

Walker Boys Unity Tutorials - Lab 1: Point & Click

As I mentioned earlier, I was between projects this week at work, so I decided to buckle down and dig into Unity using the Walker Boys Unity Tutorials. I started last week with the somewhat flimsy C# knowledge I picked up a few months back by reading this book and learned a TON about Javascripting - culminating thus far in my first lab!


Play it Here!: Lab 1 - Click on objects to destroy them (some take multiple clicks). Get 30 points to win.

Here's my info sheet for turning it in:

NAME: Cat Musgrove

TIMEFRAME: For Lab 1 specifically, worked on & Off Thurs 8/18 - Sunday 8/21 (maybe... 16 hours total?)

PROJECT DETAIL:

Followed videos closely to create a "Point and Click" game - where you click on objects to destroy as many as possible in a set amount of time. You have 20 seconds to gain 30 points. Started with project setup and asset creation - making prefabs for each object & explosion (created explosion using particle system in Unity).

Scripted player controls - ray is cast from mouse to detect collision with enemy objects. Each click lowers the counter on the enemy objects, and when they reach zero, they explode. Each enemy has variable for how many clicks they take to destroy, as well as how long they take to respawn. Enemies move to random positions on game start, and when they explode (renderer is turned off for a certain amt of time after they explode). They also choose a random color within an array of colors that you can set within Unity for each object.

Scripted score & UI. Created Main menu, win and lose screens (each had their own script). Added audio to game.

Worked on my own (without videos -- but with help from Issam) to complete the "On Your Own Objectives" which included creating additional enemies, adding 'shooting' sound, making the sphere's respawn time random, making the sphere flash before exploding, and making a square that moved. For the random respawn time I learned about coroutines and how yield WaitForSeconds reacts when you put it in the Update function directly - so I created some workarounds to not keep initializing the same script. For flashing I dealt with the same issue. For the moving sphere, I learned how to use transform.Translate with Random.Range. I also set up invisible walls around the boundaries of the screen, and learned how to use object collision to trigger events.

SOFTWARE USED: Unity & MonoDevelop

FINAL THOUGHTS: I learned a lot in a week! I'm still running into issues with Syntax, but I think I'm able to at least start looking in the right places, and think in the right sort of order. I asked for Issam's help a lot, but it was usually Syntax related - where I was on the right path, but little things were keeping it from working (example - having the moving cube run into the level boundaries - I didn't know I needed to have a rigidBody collider on the cube in order to use the OnCollisionEnter function.. that sort of thing). I look forward to the next lab!

TIME BREAKDOWN:

Mon - Weds (~8 hours a day):
Watched Intro to Unity & Intro to JavaScript Videos, took tests.

Thurs (~5 hours):
- Followed videos for project setup, asset creation
- Followed scripting videos for:
   - Player Input
   - Player Raycast
   - Random Position
   - Click Loop
   - Respawn Wait Time

Fri (~5 hours):
- Followed scripting videos for:
   - Random Color
   - Counter (Score)
   - GUI HUD
   - GUI Menu
   - GUI Win/Lose
   - Touch Ups
   - Audio Setup
- Followed video for learning how to create build
- Started "On Your Own" Objectives:
   - Add audio effect on mouse click
   - Started to create a random spawn time for the spheres

Sat (~ 4 hours):
- "On Your Own" Objectives:
   - Finished adding random start time for the spheres
   - Add 2 additional enemy shapes
   - Made sphere blink for 3 seconds before exploding


Sun (~3 hours):
- "On Your Own" Objectives:
   - Made script to make MoveCube move randomly across the screen
- Created site for hosting files, uploaded everything & did written description!

No comments: