Mouse going off window

Blitz3D Forums/Blitz3D Beginners Area/Mouse going off window

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,0,2
SetBuffer BackBuffer()
HidePointer
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
playerX=GraphicsWidth()/2

While Not KeyHit(1)
	playerX=playerX+MouseXSpeed()
	If playerX>(GraphicsWidth()-50) Then playerX=GraphicsWidth()-50
	If playerX<10 Then playerX=10
	MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
	Text playerX,500,"X---X"
	Flip : Cls
Wend