Time does not set to 0 when it should
vincentW
Member Posts: 47
my game is based on a series of spawnings of enemies, every 30 seconds the enemies get tougher.
Now I was testing my game on my iphone and when I restarted the game, the same (equally tough) enemies spawned in the beginning as at the end of the previous game. I checked the code and every way to restart had a rule that said: when touch is pressed, set game.time to 0.
This apparently didn't work. Does anyone know how to solve this?
Now I was testing my game on my iphone and when I restarted the game, the same (equally tough) enemies spawned in the beginning as at the end of the previous game. I checked the code and every way to restart had a rule that said: when touch is pressed, set game.time to 0.
This apparently didn't work. Does anyone know how to solve this?
Comments
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
An actors self.time starts at 0 when it first spawns.
self.time is the up time of an actor, so it starts counting on the spawn of the actor its being used in.
game.time is the up time of the game and starts counting at the time the game is opened up, and continues as long as the game is open.
you also have the device year, month, day, hour, minute, second, and millisecond. These are are pretty straight forward, they are referenced straight from the device.
None of these are changeable within the run time by you, but they can be referenced to be used in equations and behaviors and are very powerful in this capacity.
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮