local help

BlitzMax Forums/BlitzMax Beginners Area/local help

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.

Setting frame to global within the if statement will initialise it once and then keep it's value...
SuperStrict
Graphics 640,480
Local HIT:Int=-1
While Not KeyHit(KEY_ESCAPE)
	If KeyHit(KEY_SPACE) HIT = - HIT
	If HIT = 1
		Cls
		Global MYINT:Int
		MYINT:+ 1
		DrawText MYINT,0,0
	EndIf	
	Flip
Wend