59-New Enemy Type — Z-movement&Shoot

This post will create a new enemy type that moves in horizontal “Z” shape and shoots at the player every few seconds.

As the enemy shares a lot of behaviors similar to the previous normal enemy, we can directly inherit the existing Enemy class. The only new thing in the script is the Firing routine.

As for the new path, it can be introduced by creating a new path and assign it to this new enemy prefab in the inspector.

Path0 assigned to the normal enemy; Path1 assigned to the new smart enemy

--

--