In order to have our turret appear at the right point, we'll create a schedule that spawns new enemies as the level progresses.
game.lua for the moment and create a new file in the
level folder called
marsh-enemies.lua. This file will define a
schedule module that's 60 seconds long, so that's the first thing we'll define using the following code:
return function(game) local duration = 60 return duration end
At this point, if you previously put a placeholder duration in
game.lua to test the background scroll, you can revert that to the code that uses this file.
Next we'll use the
schedule function (from a module that isn't created yet) to start our custom
schedule function against the current game. ...