The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: ninjarider on July 13, 2005, 12:12:54 PM

Title: character movement in game programming
Post by: ninjarider on July 13, 2005, 12:12:54 PM
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.
Title: Re: character movement in game programming
Post by: Eóin on July 13, 2005, 12:32:26 PM
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) .
Title: Re: character movement in game programming
Post by: ninjarider on July 13, 2005, 12:37:37 PM
i didn't think about wrapping it around the screen.
Title: Re: character movement in game programming
Post by: zooba on July 14, 2005, 02:20:01 AM
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