News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

character movement in game programming

Started by ninjarider, July 13, 2005, 12:12:54 PM

Previous topic - Next topic

ninjarider

i currently have a project were the user can use the mouse to look up, down, left, and right. with the current code that i have the character can only do a little over a 360. i was wondering if anybody knew a way to do that.

any help would be much appreaciated.

also have a question concerning application hooks.

Eóin

The mouse is probaby hitting the edge of the screen. One way to slove it would be to constantly move the mouse back to the center before it gets close the the edge. Another would be to wrap it so it can go out one side and in the opposite.

You'll probably need to play around to see which idea, or if some other method, works best :8) .

ninjarider

i didn't think about wrapping it around the screen.

zooba

You'll probably be better off keeping it central. This is essentially how DirectInput handles it. It measures the distance of the cursor from the centre of the screen, returns these values and then puts the cursor back in the centre of the screen. It generally won't work to use the absolute position of the mouse for this type of application.  :U