Thursday, February 27, 2020

Unity's Own: Unity Tutorial 05

This week we finish off the unit we've been working on with the final lesson and them another buggy game to test our new found skills on.

In this lesson we learn how to write our very first custom function in order to make our three animal prefabs spawn at random instead of when the s button is pressed because otherwise the player wouldn't enjoy the game as much if they had to spawn the animals themselves. We use another new method as well in order to have the animals spawn by themselves at intervals.

Screenshot of game 

The second last part of making the game was to being able to feed the pizza to the animals as they run at us, we do this by using box colliders. We have to add box colliders to all the animals and the pizza which allows for the game to know when the pizza enters the space of the animals.

We then code so that once the collider senses the pizza entering the space of one of the animals they will be deleted from the game.

The very last thing we do is add a game over screen to the game incase the player cant get the food to the animal in time.

Then of course just like last time we have to put all our new found knowledge to the test by fixing a buggy game. This time we have to help a person play fetch with their dog. 

I found this test slightly harder then the last one but I like testing all the new stuff I learned.

No comments:

Post a Comment