Timing changes query

BlitzMax Forums/BlitzMax Beginners Area/Timing changes query

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.

Graphics 800,600',32
'load an image to tile
image=LoadImage("test2.png")

duration=500 'millisecs = 1/2 sec

dx=1
dy=1

timer=MilliSecs()

While Not KeyHit(KEY_ESCAPE)

	TileImage image,x,y

	'move the tiled background
	x=x+dx
	y=y+dy
	
	If MilliSecs()>timer+duration
	dx=-dx
	dy=-dy
	timer=MilliSecs()
	End If
	
	Flip;Cls

Wend