Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jan 14th, 2013  |  syntax: None  |  size: 0.40 KB  |  views: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var timerInterval = setInterval(drawPlayerRunning, 50);
  2.   clearInterval(timerInterval);
  3.        
  4. var isIntervalInProgress = false;
  5. setInterval(function()
  6. {
  7.   if ( isIntervalInProgress )
  8.     return false;
  9.  
  10.   isIntervalInProgress = true;
  11.  
  12.   drawPlayerRunning();
  13.  
  14.   isIntervalInProgress = false;
  15.  
  16. }, 50);
  17.        
  18. var func = function()
  19. {
  20.   setTimeout(function()
  21.   {
  22.     drawPlayerRunning();
  23.     func();
  24.   }, 50)
  25. }
clone this paste RAW Paste Data