New Enemy Type (Notes)

phi golden
2 min readNov 20, 2022

--

Objective:
1. create enemy types that can fire & damage the player
2. create an enemy type with a unique projectile (ie. laser beam, heat-seeking)
2. Unique Movement Behavior (Zig zag, wave …)

Game Play:

New Enemy Type:

Say hello to the new enemy type. small drone program to kill foreign players

Enemy Setup:

  1. Enemy_move script
    2. Enemy shoots
    3. add the type of sound effect the enemy does when shooting
    4. Laser spawn position
    5. must have a collider
    6. and set to a trigger
    Aside from that setting the enemy tag for logic, and layer as an enemy for
  2. collision control

1. Enemy collisions
2. Enemy death sound and point value
3. Explosion effects
4. Type of explosion

Code: Enemy_Move.cs

1. if the Player transform doesn’t exist find it
2. Using the Dot product to shift Enemy Drones toward the player with positives and negatives
3. Stop the y and x movement with the music beats
Enemy drones track the player, I’m thinking of making the drones slower in vertical speed to be half of that of regular enemies.

Code: Types.cs

Instead of filtering types threw strings we use enums for logic sorting.

Thanks for reading…
.
.
.

--

--