Introducing more Enemies to your game

Yiu Chu
2 min readJun 3, 2021

You can surely make your game more interesting by having a bigger variety of enemy.

With a larger set of different enemies, it opens up a lot of possibilities:

  • each type of enemy can give a different score.
  • give special power-up when a particular type of enemy is destroyed.
  • different enemy can have different fire pattern, making the game more challenging.
  • different enemy strength with different type
  • different enemy movement with different type
  • different enemy set for different game level

the list can go on, but more enemy types also present additional challenge in the implementation.

Spawn Manager

Most game will have some sort of Spawn Manager object to manage the real- time creation of enemy objects:

In the above Spawn Manager, it has

  • different types of Enemy Prefab for the Spawn Manager to instantiate
  • for each type of enemy, the maximum number of active ones allowed on screen
  • regardless of the enemy types, the total number of enemy allowed on screen
  • by using List variables, the ability to dynamically manipulate the data with loop and index.

As you can see, some careful design and consideration are required to make sure the game is still playable and manageable. A few limiting conditions are needed to control the enemy spawning process:

Code Snippet

End Results

Now I really like my enemies !

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Yiu Chu
Yiu Chu

Written by Yiu Chu

A senior software engineer determined to be one of the industry's best Unity developer in 2D, 3D and VR

No responses yet

Write a response