Unity Tutorial 06

 Lesson 4.4:

In the overview he talks about how with each level we will add more enemies into the level to make it more challenging and to continue the game going rather then just winning after defeating the first enemy. To do this we will be using something called a for-loop, this will loop through certain code as many times as we need as apposed to writing the same code over and over again. This seems like a much easier option and will surely save a lot of time and effort. 

Adding waves will determine how many times we get the loop, for example in the first wave we get one loop to spawn one enemy, in the 2nd loop two enemies and so on. 

Your code should look something like this when adding in the for-loop. 

Giving the for-loop a parameter:  Using parameters will help us to pass information to our method as we increase the number of enemies we are adding. 




Again here is a simple image showing the code that helps to achieve this. 

And finally the code for destroying the enemies once they have fallen off will look like this:


Overall I feel as if this was one of the much easier Tutorials to follow along with. 


Comments

Popular Posts