Computer Science Canada Move with mouse |
Author: | Newguy [ Sat Dec 13, 2008 11:38 am ] | ||
Post subject: | Move with mouse | ||
This code is supposed to make the ball follow the mouse when the mouse clicks on the ball and moves, and it does that but only if the mouse moves very slowly. I assume the mouse is able to leave the ball because it moves too fast and the thread doesn't update fast enough. How can I make it so the ball follows the mouse even if the mouse is moving at a considerable speed. Thanks for your help.
|
Author: | TheHobbit [ Mon Jan 05, 2009 9:54 pm ] | ||
Post subject: | Re: Move with mouse | ||
in case you haven't already found a solution : im not entirely sure what's causing ur problem, but im GUESSING it has to do with the repaint bit , i did a pong game and unless i had the double buffer implemented, it was pretty choppy. heres the double buffer code, you can find it alot of places online, but to simply explain what it does : it takes the graphics off ur screen, copies it all to a variable ( dont ask me how that happens, no idea) repaints, and slaps all your graphics back on the screen. < super basic way to explain it that MIGHT help the slow/chopiness , if not, well, i tried ! g'luck.
|