Unity Starters coding

When coding you have to think logically. It is like a different language, and for you to understand it I've had to learn what different words and symbols mean. Firstly we wrote out what we wanted our game to do.

For Example:



This code basically means  if the cat is asleep and the mouse is awake the mouse doesn't hide, as well as if the cat is asleep but the mouse is awake the mouse hides.

If the mouse is awake and the mouse is hiding the cat is awake.

If the mouse is not hiding then the cat is awake.


The code above allows and 3D game object such as a sphere to change colour on a click.. OnMouseDown means the statement will happen only when the mouse is clicked.

No comments: