Changing spawn rate for each level in Glitch Garden

Hi guys!

I want to improve my Glitch Garden game, so I was thinking on how make the game difficulty gets higher as you advance trought levels.

One thing I tried to do is to make the spawn rate bigger for each advanced level. Problem is: it’s the same prefab that is being Instantiated. How can I adapt the “Seen every second” for my Attackers, depending on the level the player is?

Thanks!

I am sure there is a more elegant way, but what I did was created a static int for currentLevel, used an if statement to check the currentLevel and tune the meanSpawnDelay based on currentLevel in the Spawner script and used the GameTimer script to increase currentLevel each time the game level changed.

1 Like

Thanks for the answer John! I’ll put to the test.
At higher levels it’ll be a rain of enemies haha

hi, I tackled this when implementing my difficulty settings/modifiers.

I simply added Config object to my game, just a basic object that just holds my config script, and then had that script expose some public variables for spawn rates… along with a number of other things.

I then have things that need these ‘settings’, such as my enemy spawner, grab the object and get the values from them.

It’s also the place I store the modifiers for my difficulty settings, (easy, normal, hard), as private variables, which I then incorporate into my calls for things like spawn rate, health, damage and time to survive etc.

Works really nicely.

Im in the office at the moment otherwise I would add them, but if you decide to have a go at that method and get stuck, give me a shout, and I will drop in what I have as a pointer for you.

1 Like

Hey J5Dev!
I’ll finish Bowlmaster project and get back to Glitch Garden to try your solution for this problem.

Thanks for the answer =)

Privacy & Terms