O'Reilly logo

HTML5 Game Development HOTSHOT by Makzan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Controlling enemy waves

In this task, we add a leveling system to the game. We will use a dedicated object to manage different combinations of enemies and their spawning frequency.

Prepare for lift off

In this task, we will create a new file for controlling the enemy waves. Let's call it waves.js and include it in the HTML:

<script src="scripts/waves.js"></script>

Engage thrusters

Let's work on leveling:

Note

Note that we will show only three waves here. The three waves in the book are presented for demonstration purposes. In reality, we have much more waves that are declared. They are just different combinations with different amounts. So, we don't want to paste the whole waves' data here with duplicated content. Please check the code example for the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required