Project 1: Space Shooter
The Boss part 2
The Lasers, the homing missiles and the beam weapons
Next up are the offensive capabilities of the boss enemy. The lasers and the homing missiles are nothing new, although there will be a twist for this, but the beam weapon is something new. This one can destroy everything on its path, except for the player that is.
The basis for the lasers and the missiles is the previously done weapons, they are just assigned with the enemy status, the same as for the normal enemies.
The difference will be that both of them will have a spread type shooting pattern. One to the left and one to the right. For both weapons and sides the spread is ninety degrees.
At the minimum the angle between the lasers is ten degrees, and for the missiles twenty five degrees. But this will change depending on the amount of health the boss has, that is the actual angle will be determined by multiplying the minimum angle by the current health.
The same applies for how often these weapons are shot, less health more often the shots will come. Done this way the boss enemy will become gradually harder.
The beam weapon will have one beam on the left and one on the right side, but these ones will sweep the whole ninety degrees. The direction, from bottom to the sides or vice versa, will be determined randomly.
The Random.value method produces a value between zero and one, with both extremes included. This value is then rounded to be either zero or one with the RoundToInt method. If the value is zero then the sweep is from the bottom to the side, and if it’s one the sweep is to the opposite direction.