Archived

This topic is now archived and is closed to further replies.

Ructions

Mouse Movement

Recommended Posts

i am making an arkanoid type game and am using the mouse to move the paddle. i have it set up that if the mouse points goes past a certain point that it goes back to the center of the screen to that the paddle will move all the way across. but its not working right. i was wonder what other ways is there to do this. Please Help. Thanks in Advance Ructions

Share this post


Link to post
Share on other sites
At startup:

POINT p;
GetCursorPos(&p);

the initial cursor pos is now stored in p
when you want to check the mouse movement:

POINT cp;
GetCursorPos(&cp);

the current cursor pos is now stored in cp
movementx = cp.x-p.x
movementy = cp.y-p.y

you now know the mouse movement, reset the cursor pos:

SetCursorPos(&p);


WWW.TREEPENGUIN.TK

Share this post


Link to post
Share on other sites