Time decimals

hamarohamaro Member Posts: 31
edited June 2012 in Working with GS (Mac)
So i made a timer of a change attribute (timer to timer+0.01), every 0.01sec. All of a sudden theres 0.000001 decimals showing up, how do i get rid of those? Or is there better ways to do timers?

Best Answer

Answers

  • hamarohamaro Member Posts: 31
    Also the timer doesnt reset at the next scene. It starts counting down first from the time from previous before it starts what should be the actual time. Why?
  • hamarohamaro Member Posts: 31
    I made another timer by using actor.time and i will use booths code tomorrow. Then the whole function is complete and fully working.

    But when im previewing, after replaying the level a few times the timer start gets delayd.
    First level start up, clock starts on level loaded, after ~3 start ups it takes about 1 second till the clock starts ticking. 1 sec till it starts counting from 0.
    I switch scenes like this Menu->Game->Menu->Game.

    Am i doing something that's heavy for a certain part in the engine or why do i get a delay?:)


  • domeniusdomenius Member Posts: 108
    I would recommend looking into using game.time instead of a timer for this, my GS optimization thread goes into why GS timers suck for some things and how to replace them. There is also a stress test demo (not on the first post, further down on the first page) that shows this exact problem with "loosing time" when using timers for logic. Check it out here: http://forums.gamesalad.com/discussion/44707/timers-are-for-chumps-gs-optimization-tips
Sign In or Register to comment.