Wednesday, 4 September 2013

Help Screen

It took me a while to figure out how to make a help screen.  In the end I decided to configure the help button in the main menu so that when pressed, the other objects in the screen disappear and the help screen appears, when the mouse comes up then the screen reverts to normal.  This was a simple but effective solution.  As I no longer had my laptop and no access to photoshop, the help screen was made in Paint.



Above is the code attached to the help button.



LIVES GUI



I followed another Tornado Twins tutorial to add and subtract lives on collisions.  The tutorial can be viewed here.  These were modeled in Paint as I had no access to Photoshop.

Level 1 Start


This is how level one starts, you are at the entrance to the maze.  The font in the background is "AngelicWar".

Level 2 Collider


This is the Collider that will bring you to "Level 2" if you walk into it.

Final Versions of Susie and the Spider



These are the final models of Susie and the Character before bringing them into Unity.  Susie got slightly warped during animation and after I had fixed her I decided I had actually preferred the slightly warped, lopsided teddy and so exported this version.

Main Menu



I used a very helpful TornadoTwins tutorial to help me make the main menu.  It show you how to link an object so that clicking it will load the game.  I used the same principles for my level 2 collider.  The tutorial can be viewed here.

Bubbles



The above image, along with the animation.Play script are the bubbles in the maze that aid you through the maze.  If you see one, you know you are going the right way, but,  they do not tell you which direction you are going in so it is still very easy to get lost.

Life Pickups


If Susie has lost a life the running into one of these restores one life.  This was modelled in Blender, and animated in Unity.  It expands and contracts every second, kind of looking like a heart beating.

Tuesday, 3 September 2013

Physics

Unity is an amazing program, the possibilities seem endless, and for the most part it is not too difficult to use.  However, collider physics nearly sent me to an early grave.  


The following links helped me grapple with physics.



The most helpful answer of all time!!!     Guidelines for using Colliders and Rigidbodies

The previous link helped me finish the game.  I spent days and days making zero progress and had tried every manner of google search to no avail.  I accidentally found the above answer and after reading it once, everything seemed to make sense and I understood why the things in my game were not working.  Nothing was colliding correctly, and the bullets kept going through the floor.  There was only so much one can learn from a tutorial, they are only guidelines.  It took another few days but I managed to re-work all the objects and characters and finally they were interacting as they should.

Unity Camera Animation, Animating Prefabs

I had thought that Unity animation would be quite complex and confusing and to one extent I was very wrong, it can be unbelievably simple to do some basic animation, such as a camera fly in (seen on my main menu).  I learned how to do that here! a very simple tutorial showing camera animation.

The animation features in unity get very confusing when you try and animate a prefab (as I had to do for the heart and the bubbles).  I had assumed that you could just apply the animation, convert your object to a prefab, duplicate it a few times and place them around your scene, alas, you cannot.  The prefab keeps taking the animated coordinates and the after many hours of trying to fix this, and after following many different solutions online (none of which worked) I realised the answer was straightforward (once you had figured it out).  You must animate the prefab AFTER it has been converted.  Then place the animated prefab inside of an empty game object.  This empty game object can then be duplicated, and THIS can be placed around your scene.  The animated coordinates now occur inside the empty game object so from the outside it looks like you are mapping the new coordinates to it.  You're not.  But it works.

Susie walk cycle and Jump


Susie's walk animation.  Did not make it into unity.  The jump animation caused too many problems to export, so I actually applied gravity in Unity and attached it to the space bar, so every time you hit space bar the teddy moves up the y-axis a certain number of metres depending how strong the force of gravity is set.

Export Blender to Unity

Helpful tutorial on getting textured, rigged and animated character from Blender to Unity. Click me for tutorial.

Susie Idle Pose


This idle pose worked when it was brought into Unity!! yaaa!  This animation would kick into action any time the teddy stops walking.  This is done using the following code.  

Susie Run Cycle


This is a video of the teddy run cycle that didn't make it into Unity.  I didn't spend a huge amount of time on the actual animation.  Most of the time actually went towards trying to get this to work in Unity, but unfortunately I couldn't get it working in time.  If I had managed to get it working I would have edited it to make it move faster and look more like she's running.

Final Version of my Heightmap

I used the following tutorials to create my heightmaps for the maze. HEIGHTMAP TUTORIAL . 

It explains how to set the contrast of an image to turn it into a maze in unity.  white will be the highest points on the terrain, and black the lowest.

this is the third version of the maze.  the first version was too big and the second version was lost when my computer decided to malfunction for a while (lost a huge portion of the game and just to clarify, it had been saved in two places but for some reason the file malfunctioned and I lost a version of the game and had to start again).