Thursday, February 27, 2020

Unity Tutorial 5

Last week in our unity tutorials we made a kind of space invader-esque game using pizza and farm animals, which is great but this week we're looking to improve upon that. So lesson 2.4 focuses on making a couple of improvements, first of all we make the animals spawn completely randomly instead of on command to make the game somewhat challenging. We do this by writing a function in the code to mark the spawn range as random before we throw in some additional code so they spawn on a timer.

Next we needed to fix the problem of projectiles flying through the animals when they connect with eachother. Using colliders and checking the "Is Trigger" button we created an interaction between the animals and the projectiles, in the next step we added code to turn that interaction into the deletion of the animal. Finally we use code to trigger a pop-up game over screen should an animal make it past the player, and with that our space invader/farm animal game is functional.

We also had bit of  challenger to do for this weeks tutorials, this was pretty much to make with the same concept as the one we've been working on, but with a different arrangement, this mainly consisted of reusing what we had just learned but it was cool to see how we can make different looking games using the same mechanics.

"Fetch Game"
Source Unity

No comments:

Post a Comment