Advertisement
Ham62

SimpleGameLoop.bas

Sep 8th, 2018
1,361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 0.37 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement