Saturday, October 29, 2011

[Unity] Lab1

This Blog is for an online Lab1 for walker studios UNITY lessons.

The first lab was a lot of fun even though the game is rather simple.

The lab was to make a simple point and click game where you destroy shapes as you click them to accumulate points.  I didn't add much fluff to the file, but I did all three on your own things + the extra credit (which in my opinion was WAY easier once I did the other three).

The file for the game can be found in a .zip folder here hosted on media fire: http://www.mediafire.com/?9d7d960l74ueg62

Time Frame:
The actual time it took me to complete this project was:  7 hours

8/31:
I watched the instructional videos and followed along from 10:30PM until 2:30AM finishing the program along with the videos.  I then spent 2:30 until 3:30AM thinking about the three self made items to add to the game.

9/1:
I sat down at 12:50AM to begin working on the project that was designed for self learning and extra credit.
I finished the build at 2:50 AM logging another 2 hours.

Project Detail:
Name: Jason Carter

The game was a Lab for the online Unity Course.

It took 7 hours over 2 days of research and development.

It was a fast paced point and click game implementing moving shapes and objects around a screen using the Left Mouse Button for all actions.

It was developed using Unity and coding was done in JavaScript.

Final Thoughts:  This was a great way to learn how to make a simple game.  It taught me how to research differently and for different things.  I am a good critical thinking but I think I slack on the research sometimes to do something the BEST way.  Now I am not sure if I did i the best per say, but I did come on a really tough snag with the moving cube.  I was trying to use a controller object to move the object in a certain direction and then I tried with SimpleMove.  Neither was working at all the way I wanted.  I had to research a better way to code what I wanted and learn the right words.  I found out that I could use Translate to move the objects.  Once i figured that out plus learning a little about Time.deltaTime and Time.fixedDeltaTime and was able to implement both of those, I was able to figure out how to make the cube (and later the sphere) do exactly what I wanted.

I was able to make the cube move in a random direction - changing every few seconds  based on a variable, and when it left the screen I would reset its X and Y positions to a random location within the screen.  The blinking sphere was rather simple, and I added a boolean variable to check whether or not you want to randomize the spawn times and I just added that to the code.  That was really simple.

For the sphere I just made a variable and had it rotate 360 degrees.  Because of timing issues, I was forced to  multiply and divide by Time.fixedDeltaTime to get the desired result each frame.  As the degree rotated through 0 to 360 over and over, the sphere object translated itself in a vector pattern that changed it's direction every frame.  Using Mathf.Sin and Mathf.Cos  I was able to specifically point the X and Y location where I wanted it to be each frame.

This project has been tons of fun, and I look forward to completing LAB2 and learning more about Unity!

Thank you guys for your hard work,

Jason Carter

No comments:

Post a Comment