How can I get game Idle time
  • Hi

    Can anyone tell me how can I get Idle time.

    Thanks in advance

    ~PS
  • What exactly do you mean by "idle time" ? Do you mean the time between to call to the game loop ?
  • Hi

    Thanks for quick reply. "idle time" means when player not doing anything.

    ~PS
  • Somewhere on you game you check for use input. For example using the keyTracker for example:
    var idle = true;
    if($.gQ.keyTracker[65]){
    //...
    idle = false;
    }
    if($.gQ.keyTracker[68]){
    //...
    idle = false;
    }
    if($.gQ.keyTracker[87]){
    //...
    idle = false;
    }

    Since you change the value of idle if any important key has been pressed you can use it to detect that the use is idle.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!