Monkey
Store
Community
Apps
Contact
Login or Signup

is my pc to slow or monkey ? drawrect(mousex,my)

Monkey Programming Forums/Monkey Programming/is my pc to slow or monkey ? drawrect(mousex,my)

GC-Martijn(Posted 1+ years ago) 
The rect is keeping out of sync with the mouse cursor.
Is this becauce my pc is to slow ?

Or in other words, the mouse cursor is moving to fast.
How to handle this ?

Or maybe my pc is to slow :S

Strict
Import mojo

Class MyGame Extends App
	Field XMouse:Float
	Field YMouse:Float
	
	Method OnCreate:Int()
		SetUpdateRate 30 ' or 60
		Return 0
	End
	
	Method OnUpdate:Int()
		XMouse = MouseX()
		YMouse = MouseY()
		Return 0
	End
	
	Method OnRender:Int()
		Cls
		SetColor 255,0,0
		DrawRect(XMouse,YMouse,20,40)
		Return 0
	End
End

Function Main:Int()
	New MyGame
	Return 0
End