Game Development Community

Difficulty Progression Help

by Andrew Nare · in Torque Game Builder · 01/31/2009 (4:45 pm) · 2 replies

I've been trying to add progressive difficulty to my game by increasing the spawn rate of an object every minute or so. I'm not familiar with TorqueScript so I don't know how I could do something such as this.

If anyone has any ideas on how I can increase the spawn rate of an object at set intervals of time I'd really appreciate the help.

#1
02/01/2009 (5:34 am)
You can use the 'schedule' function to increase spawner. Like this:
function Spawner::IncreaseRate(%this, %newVal)
{
   %this.spawnRate += %newVal;
   %this.scheduledRate = %this.schedule(30000, 0, "IncreaseRate", "5");
}
Just call it once when needed. End the scheduled event by using 'cancel':
function Spawner::StopRateIncrease(%this)
{
   cancel(%this.scheduledRate);
}
#2
02/01/2009 (8:48 am)
Thanks much Steven. I'll let you know if it works once I test it.