Controlling the game with the Overlord
In this game, we will be using the Overlord, the master controller of the game, to control the spawning of enemies, monitor the player's lives, and deal with the win/lose condition. The win condition will simply be to survive for two minutes against waves of enemies. The lose condition will be that the player runs out of lives.
Spawning waves of enemies
We need to start by creating the wave of enemies, so that the game is playable. For this, we will utilize a looping timeline to spawn the various enemies. We are going to have three different waves, each one spawning a different enemy every two seconds.
- Create three new scripts, and name them:
scr_Wave_Strafer
,scr_Wave_SpaceMine
, andscr_Wave_FloatBot
. - We will ...
Get HTML5 Game Development with GameMaker now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.