This week I finished the final set of tutorials for the arcade-style sumo battle game and completed a challenge. I learned how to spawn up to 3 enemies by adding a new void to the SpawnManager and using for-loop. I also learned how to make the number of enemies increase with waves using the (++) operator as well as getting the power-up to respawn in a random spot at the start of each wave.
In challenge 4, I had to correct the scripts of a soccer themed game by applying what I learned from the sumo battle tutorials. I fixed the issue of the enemy flying towards the player instead of away when they collide by subtracting "transform.position" from "other.gameObject.transform.position" instead of the other way around. I replaced the "Powerup" tag under the enemyCount variable with "Enemy" so that a new wave begins when all the enemy balls are taken out instead of when the player collects a power-up. I also made the power-up's effects temporary. I made the number of enemies increase by 1 when a new wave begins using the (++) operator. I was a little unsure about how to get the enemy balls to move towards the goal but looked at the hints for some help then added a playerGoal variable.
This challenge took some time to complete because the scripts have a lot of code and I had to scan it all to find the errors but the comments helped with this.
Comments
Post a Comment