New Enemy Detected — Enemy Types and Behaviors

He is doing his best.
  1. A bomber ship that lays down mines
The Bomber!
  1. An aggressive ship that rapidly tries to ram the player, the harasser!
The Harasser!
  1. A “sniper” ship that sits in the back and tries to line up with the player to shoot them.
The Sniper!
Nothing new here, just the base enemy moving down the screen.
Same logic for movement.
The Harasser has entirely different movement.
The Sniper doesn’t want to get close!
Base Enemy: Nothing new here. Move down the screen, shoot at will.
Bomber: Very similar, but we instantiate a new object (enemyBomb) and play a new sound effect.
We call this in Void Start as the object is spawned in.
This contains the logic for the light, as well as the command for it to move down the screen.
Placeholder pseudocode.
Most of this is the same as the base enemy.
This is similar to the harasser’s movement logic.
The 4 enemy types are prefabbed.
We can swap the prefabs and set those variables here instead of in code!
Line 9
The Array seen in the Inspector.
Short display of all enemy types!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store