Performance : Timer, Self.time,game.time

irongirong Member Posts: 41
edited November -1 in Working with GS (Mac)
Hello guys,

Regarding performance, what do you think is "eating" the most ressource ?
Timer :
Self.time
or
Game time?

for exemple if i want a score to go up every 2 seconds if it's better to :

1 timer rule : every 2 sec score+1

or

store the last score time then Rule : IF Game.time = OLD.score.time +2 Then Score+1

what do you think guys?
thanks

Comments

  • m456arcusm456arcus Member Posts: 189
    I'm no expert, but saving the last time every 1 second might be a resource hog. But, I have heard about how bad timers are...
  • AppsRacKAppsRacK Member Posts: 346
    Based on what i've read in here on some old post. The timer attributes consumes a lot of memory than using self.time. Logically thinking i think its true coz self.time is already running behind your system while your game has loaded so why not use it. I'd rather pass the self.time attribute to another attribute than leave another timer running all through your game. Thats why on the updates im making on my game im ripping of all timer and replacing them with self.time.
  • irongirong Member Posts: 41
    thanks for you advices guys
  • irongirong Member Posts: 41
    ok i found something hudge. It's my score constraint image that make the little freeze in the beginning... then it seems it goes in memory or i don't know. So to avoid those little freeze i got to remove the constraint lol :).
    Well i'll tell you if i find a way
  • irongirong Member Posts: 41
    ok instead of constraint i simply use change attribute with a triger. Works fine. I also discover that it's better to load all the score images before... to avoid freeze at the start of the gaming phase. So i just start counting on the home screen in alpha 0. No more freeze when starting my game now... :)
Sign In or Register to comment.