The first thing we will do to start off Part 2 of the Wave Spawner is create an IEnumerator that will take an argument type Wave. IEnumerators allow us to wait a set amount of seconds, almost like a pause, when it is called. This is important for spawning our enemies because we made a spawn rate variable that will be that “pause”. IEnumerators need to return a value, so we will use yield break, which return nothing, for now and set the state to the enum of SpawnState.Spawning.
In this article, we will cover how to setup a generic Wave Spawner. I am attaching this Wave Spawner script to a Spawn Manager object, but if you have a Game Manager object you can attach to that as well.
In the Wave Spawner script, the first thing we will do is define what a wave is being creating a new public class. Inside this class there are going to be a few public variables:
In this article we are going to cover creating an Enemy that will have the following behavior:
Main Ship Movement
In this article we will cover a Player power up that creates a destructive beam.
In this article we will cover how to create a Power Up that will give the player the ability to attract other Power ups without moving.
In this article we are going to cover how to make an enemy that can take aim at a moving player or target.
First, lets create the Enemy game object. The enemy is going to be made up of two game objects: the ship and canon. The ship will being just moving down the screen and the canon will be the object that will be aiming and firing at the player. The canon should move with the ship, so we will make it a child of the ship.
In this article I will go over how to add a turning left and right animation when the player moves in that direction.
We already have the turning left and turning right animations imported into our project. In the animations I am use they are only two frames because we want the plane tilt to be quick, so the player feels the turn directly when they hit the corresponding button.
In this article we will cover how to switch between two enemy behaviors. This article is a continuation of two previous articles that covered the enemy dodging the player’s shot and the enemy constantly rotating and shooting at the player. I am just covering how to go between these two behaviors.
The objective of this new enemy behavior: