Mouse emulating joystick challenge

Blitz3D Forums/Blitz3D Programming/Mouse emulating joystick challenge

Ah, this then?
Graphics 800, 600, 0, 2
SetBuffer BackBuffer()

px = 400
py = 300

Repeat

	Cls
	
	dirX = (MouseX() - 400)
	dirY = (MouseY() - 300)
	If Abs(dirX) > Abs(dirY) Then dirY = 0 Else dirX = 0
	MoveMouse 400, 300
	
	px = px + Sgn(dirX)
	py = py + Sgn(dirY)
	
	Oval px, py, 10, 10	
	
	Flip

Until KeyHit(1)