gaps in lines

BlitzMax Forums/BlitzMax Beginners Area/gaps in lines

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.

Hello,

Since I just started, I'm doing something simple. You draw with your mouse pointer (hold down left button). But gaps can appear in the lines once in a while. Why is that happening? Here is the code:

Strict
Local x#=MouseX()
Local y#=MouseY()
Local width#=800
Local height#=800

Graphics width,height,0

While Not KeyDown(Key_Escape)
	DrawText "Right button = Clear screen",0,0
	DrawText "ESC = quit",0,15
	If x And y <> 0
		If MouseDown(1)
			DrawLine(x,y,MouseX(),MouseY())
			Plot MouseX(),MouseY()
		EndIf
		If MouseHit(2) Then Cls
	EndIf
	x=MouseX();y=MouseY()
	Flip
Wend