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)
| 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
| While I am not sure of the extent you are seeing this lag, I'd wager that there will always be lag to some degree. I can notice it at 30 FPS and it's still noticeable at 60 FPS (though not as much).|
Maybe you could hide the mouse cursor to make the lag less obvious?
| The OS mouse cursor is bound to be ahead of your game as the OS reports the mouse position which is then handled in the update and later used in the render. |
| What target are you testing on?|
This could also be down to vsync...
| at the moment the target is html5|
maybe I have to hide the cursor, so there is no visible lag anymore.
And I have to check this with a other pc.
| this is essentially the same method I used to draw the light in pizza pestz and never noticed a problem with lag (drawing 4 recs and 2 images with alpha) my money is on pc speed like you said or possibly even your browser?|
Have you tested it in both Chrome and FF?
| Wasn't there a problem with Setcolor being really slow? |
this is essentially the same method I used to draw the light in pizza pestz and never noticed a problem with lag
You can't see the OS cursor in your submitted Pizza Pestz app. That makes it difficult to see the lag.
| Using SetColor in HTML5 is bring your FPS down for sure and you will notice a lag. |
| It was a weird hardware/software problem, I reinstalled windows with the latests drivers and now its moving as fast like light ;) |
| I do hide the cursor on it but I dont when debugging, the lag just isnt there in pizzapests|
glad you sorted it :p