5 Days Mechanic – Body Disposal

Today I tried to come up with the coding for one of the 5 Days mechanics. As I am still quite a novice at coding, I chose to produce the body disposal mechanic as I felt this could be relatively simple. This is where you, the protagonist, approach the body or person, pick it up and drop it off somewhere. If we decide to take this idea forward as the final one idea, I hope to try and expand on this mechanic by taking into account having to attack the object without being detected first. Even if we don’t take this forward, I may still try to attempt this anyway.

I haven’t used Unity properly in a very long time, so I started today by messing around with some of the settings. Through doing this, I managed to remember how to create a plane, create a 3D object, apply a rigid body etc; this made my confidence grow.
I started out by designing the code in my book as I struggle to take it straight to code. Using this technique has definitely helped me to improve and also showed me that I know more than what I give myself credit for. I would like to try and produce more pseudo code in order to bring my confidence levels up as well as help me to design better code through practice.

See Lectures/Crits/Talks book, light pink tab labelled 5 Days Body Disposal, pages 72 – 77 for all of my notes clearly.

From here, Dr James and I discussed how I was looking to make this a 3D game and so he helped me accordingly to work out what extra bits and pieces I would need in my code. Having Dr James to help me fix my code meant that I could add appropriate annotations and comments to the code with how I go about doing things for future reference. This will also certainly help me in order to practice and remember certain terminologies that I often forget the meaning of. I plan to use commenting in my code more in order to help me progress my skillset.

Here are the three tries of the prototype that I made:

I’m really pleased with myself as I have been learning through using the commenting element of Unity. Now that I know how to do this, I will be making sure that I make comments and notes in all of my code so that whenever I look back at them, I can figure out what I’d been doing straight away. It could also help me to create new code as if I look back, I can figure out what I can recycle or see if I can change anything.
The best thing too is now that I have these, I can create a library of scripts so that I can use them whenever I need to.
Below is the code:

 

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