Best way to use functions?

Blitz3D Forums/Blitz3D Programming/Best way to use functions?

I guess there's no hard and fast rules but consistency makes development quicker. I generally use this kind of format with all globals / consts & types declared at the top of the code. This snippet is from the source to my tanks game ..

All the functions are declared after the main loop.


GAMEinit()

Repeat
	GAMEstart()
	Repeat
		WaitTimer(FrameTimer)
		BULLETSupdate()
		PARTICLESupdate()
		BONUSupdate()
		TANKSupdate()
		UpdateWorld()
		RenderWorld()
		Delay 5
		Flip
	Until QUIT Or GAMEOVER  
	If GAMEOVER GAMEend()
Until (1=2)