increasing difficulty
RocketBrain
Member, PRO Posts: 269
hey all, need some help.
in the timer behavior can the time be a value such as game.difficulty?
the game i'm working on needs that time to be reduced gradually so i tried doing
timer: every game.difficulty second
spawn actor: actor1
timer: every game.difficulty second
change attribute: game.difficulty = game.difficulty - 1
in my mind that should make game.difficulty go down by 1 second every round, and then spawn an actor that many seconds.
so set the starting value at 10.
first round every 10 seconds it spawns actor one.
next round every 9 seconds..
next round every 8 seconds..
....
but it doesnt work. any ideas?
in the timer behavior can the time be a value such as game.difficulty?
the game i'm working on needs that time to be reduced gradually so i tried doing
timer: every game.difficulty second
spawn actor: actor1
timer: every game.difficulty second
change attribute: game.difficulty = game.difficulty - 1
in my mind that should make game.difficulty go down by 1 second every round, and then spawn an actor that many seconds.
so set the starting value at 10.
first round every 10 seconds it spawns actor one.
next round every 9 seconds..
next round every 8 seconds..
....
but it doesnt work. any ideas?
Comments
Use a game counter that ticks up with each spawn that counts how many actors are spawned.
Then in an invisible controller actor...have a rule that states:
[ DEFAULTS ON SCENE START ]
change attribute: game.gameOver = false
change attribute: game.roundID = 1
change attribute: game.spawnCount = 0
RULE:
when game.spawnCount = self.spawnsPerRound and game.gameOver = false
.....game.roundID = game.roundID + 1
.....game.spawnCount = 0 (this resets the counter for the next round)
.....RULE (EMBEDDED IN ABOVE RULE):
..........when game.roundID = 11
..........game.gameOver = true (this will shut off the loop when 10 rounds are complete)
Then have in your game's controller actor as well...below (and separate from) the above rule:
RULE: when game.gameOver = false
...Timer: every [ 10 - game.roundID ] seconds >>
.......spawn actor >> actor1
(this will spawn an actor from 10 to 1 seconds with a reduction by 1 second each round)
Then in your separate spawning actor...
RULE:
game.spawnCount = game.spawnCount + 1
Another way to do your spawn timer is:
Timer: every [ 2 - (game.roundID * 0.1) ] seconds >>>
.....spawn actor >> actor 1
This will make the actors spawn every 2 seconds at first round...then reduce by 0.1 seconds to 1 second by the end of the 10th round.