Timing

Blitz3D Forums/Blitz3D Beginners Area/Timing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

In BlitzPlus (WaitEvent doesn't apply to Blitz3D), I use WaitEvent exclusively. The only reason I can see not using it is for backwards compatibility with Blitz2D.

You are correct in your other assumptions.

I usually start with a loop like this:
CreateTimer(60)
InitGui()
InitGame()

Repeat
	Select WaitEvent()
		Case $803 : End
		; other cases here (input, etc)
		Case $4001
			Logic()
			Update()
			Render()
	End Select
Forever


You can even enclose the Select WaitEvent() block in a Select GameState block, along with more Select WaitEvent() blocks for other states.