I'm creating a dodging game where the player must avoid red balls falling from the top and bottom of the layout. To start with the objects are created every 3 seconds but how do I set it so the object is created every 2 seconds after 30 seconds and then every 1 second after 1 minute to make it harder?
Use a global variable and change it to every 'variable' seconds. The variable initially is 3. Then with a separate variable that counts down or with a timer, after 30 seconds subtract 1 from the variable then that event would be every 2 seconds etc.
Develop games in your browser. Powerful, performant & highly capable.
Thanks a lot - I've done this and it worked but how do I stop the global variable going below 0? It makes the game glitch when it gets to 1 minute 30 seconds.
On the event where you reduce the variable every 30 seconds you can add a condition there that variable must be greater or equal to 0.
You're good at this - it worked! Thanks so much! :)