|
Post by Azan on Jun 3, 2005 21:11:09 GMT -5
Now whenever I begin a new program I can never remember how to set everything up, this is what I use to help me and maybe it will help you too. NOTE: this outline also contains code that makes your framerate constant, with out it the game would run fast on one computer, and slow on another, this is a must. (note by changing the const "FPS#" in the program you can speed up or slow down each loop. Graphics 800,600 SetBuffer BackBuffer() ;DEFINE VARIABLES/TYPES HERE
;;;;;;;;;;;;;;;;;;;THIS MAKES FRAMERATE CONSTANT A MUST NEED Const FPS# = 60;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; period = 1000/FPS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; timer = MilliSecs();;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While Not KeyHit(1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;THIS ALSO MAKE FR CONSTANT ticks = (MilliSecs()-timer)/period;;;;;;;;;;;;;;;;;;;;;;;; For k=1 To ticks;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; timer=timer+period;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cls ;BEGIN MAIN LOOP
;INSERT MAIN LOOP HERE
;END MAIN LOOP Next ;FINISHES FRAMERATE CONSTANT Flip Wend
;FUNCTIONS HERE
|
|
|
Post by Umbrafire on Jun 18, 2005 11:00:04 GMT -5
thanks a lot, azan, this will be really helpful
|
|