Ham62

SimpleGameLoop.bas

Sep 8th, 2018
812
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. DIM SpeedTimer AS DOUBLE
  2. DO
  3.     IF ABS(TIMER - SpeedTimer) > .5 THEN SpeedTimer = TIMER  ' Sync timer
  4.     DO WHILE (TIMER - SpeedTimer) > 1 / 120
  5.         IF iMultikey(1) THEN EXIT DO  'Esc
  6.  
  7.                 '**** Main game code goes in here ****'
  8.  
  9.         SpeedTimer = SpeedTimer + 1 / 120
  10.     LOOP
  11.     IF iMultikey(1) THEN EXIT DO  'Esc
  12.  
  13.  
  14.     '**** Render Frame for graphics here ****'
  15.  
  16. LOOP
RAW Paste Data