Timer Creation

BlitzPlus Forums/BlitzPlus Beginners Area/Timer Creation

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.

Is this what you mean?
Graphics 800,600,32,2
SetBuffer BackBuffer()

Global timer,count=1000,seconds=60

Function CreateTimer_()
	timer=MilliSecs()
End Function

Function UpdateTimer_()
	If MilliSecs() > timer+count
		seconds=seconds-1
		timer=MilliSecs()
	EndIf
	
	If seconds=0 Then Notify "COMPLETE!":End
End Function

CreateTimer_()

Repeat
	If KeyHit(1)
		End
	EndIf
	
	Cls
	
	Text 10,10,seconds
	
	Flip
	
	UpdateTimer_()
Forever