Results 1 to 3 of 3

Thread: [VB6] Managed Game Loop

Threaded View

  1. #1

    Thread Starter
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    [VB6] Managed Game Loop

    What I have written is the proper way to setup a game loop that's locked at a certain framerate in realtime. For those who are addicted to Timers, you will not find any here. Timers are slow, sluggish, are not realtime, and get worse with the more you run simutaniously, mainly cause every other timer has to fire off all the code within it before the next one does. A proper game loop should look like this (Note that it's in pseudo code) :

    VB Code:
    1. Do While Running = True
    2.  
    3.      DoEvents
    4.  
    5.      Lock_Framerate 60      '60 frames per second
    6.  
    7.      Clear_Window
    8.  
    9.      Update_Game 'Physics, Movement, etc.
    10.  
    11.      Render
    12.  
    13. Loop

    Enjoy the code.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width