Skip to main content

UNITY TUTORIAL 04

Various devices illustration from Freepik.

This week I completed the final set of tutorials to create a simple animal feeding game. I learned how to make animals spawn on their own rather than having to click "S" to do so. This involved creating a custom function and moving the if-statement under "void Update" to this new function. I also learned how to make the animals spawn after a certain timeframe. I learned how to add box colliders to the animals and how to edit the size of these box colliders. Moreover, I was taught how to make the animals and pizza disappear when they came in contact with each other. I added an else-if-statement that triggers a "Game Over" message when an animal surpasses the player without being fed. 

Following this, I completed a challenge in which I had to correct a game similar to the one in the previous tutorials. The final product should allow the player to spawn dogs to catch falling coloured balls. The dogs were initially automatically spawning at the top of the screen so I changed the elements under Ball Prefabs in the Spawn Manager object to the 3 different balls so they would fall from the top of the screen instead. To make the player spawn dogs instead of a green ball, I placed the dog prefab in the Player object under the player controller script. I resized the dog's box collider so the balls would be destroyed when in contact with the dog. I edited the DestoryOutOfBounds script so the balls would disappear once they reach the bottom of the play area and the dogs would do the same when they reach the edge of the play area. I added an int index variable to allow random coloured balls to spawn. 

Personal screenshot from my attempt at challenge 2.

This challenge was a little difficult and involved some trial and error but I was able to complete it in the end. As per usual, I referred to the tutorials from the animal feeding game for some help if I was stuck.

Comments

Popular posts from this blog

INTRODUCTION TO SOMEONE WHO'S JUST VIBING

HEY!! Look who made it to her second year of college!! Me, Nadine, I did!! Yeah, I'm even more surprised than you are.  Happy girl illustration by 94MLK_ on Twitter. Saved from Pinterest . Last year wasn't too bad, but that was up until the whole country went into quarantine and I began to fear for my college career. I was constantly on the verge of giving up on my assignments but I would like to thank my friends for not allowing that to happen. I'm so glad I get to start year two with them and hopefully we'll make it to the end together too!  Despite the stress, there are a few pieces of work from year one that I'm proud of. I liked the websites that I created for Web Development 1 and 2, the video I edited from Introduction to Digital Media mission 3 and the advertisement poster I made for Digital Photography. I hope to produce better work this year.  Personal screenshot from the index page of my web development 1 project. Personal screenshot from the index page

FIRST PLAYABLE

Continuing with the creation of my game, I resized the player character to make them even smaller based on a comment that was left on my last project blog. I also repositioned the trees to make the space slightly narrower and added some flowers to bring some colour into the scene. With reference from the animal feeding game tutorial, I was able to get the player moving left and right by clicking the arrow keys. I brought in rocks and a branch for obstacles but I need to apply a SpawnManager script and get them to spawn randomly during gameplay. I also have to figure out how to get some branches falling from the trees and bringing in power-ups and points too. Screenshot from Unity3D of my game production.

GAME IDEA RESEARCH

Runner animation by Otilija MorozaitÄ— from Dribbble . Following last week's game brainstorm , I have decided to focus on and develop my idea of creating an infinite runner game and will be thinking about three game mechanics I will include. I will be drawing inspiration from the Ghibli Studios film, "The Secret World of Arrietty" for the theme of my game.  Obstacles are implemented within games to create a challenge for the player and to make it more difficult for them to win or in the case of infinite runner games, prevent them from playing forever and becoming tremendously bored. For my game idea, I plan to scatter stones along the lanes that the player must jump over or switch lanes to avoid. There will also be twigs falling from the trees which will create shadows before hitting the ground so the player is aware and can attempt to avoid them. A feature will be applied that allows the player to move left and right. Rewards will be available to the player throughout th