Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Mouse Speed help

Author
Message
Waltzy
18
Years of Service
User Offline
Joined: 1st Jun 2006
Location: UK Cornwall
Posted: 2nd Jun 2006 00:57
hey all, bit of a noob here, picked up DBc and im trying to make code to slow down or "cap" the speed of a your mouse in game, the code is.... choppy dose anyone have any suggestions ?


any help would be grate.

Thx

Waltzy

-Pending-
Waltzy
18
Years of Service
User Offline
Joined: 1st Jun 2006
Location: UK Cornwall
Posted: 2nd Jun 2006 01:00
sorry


-Pending-
Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Jun 2006 16:56
This works, there may be better ways.




Waltzy
18
Years of Service
User Offline
Joined: 1st Jun 2006
Location: UK Cornwall
Posted: 2nd Jun 2006 23:20
works alot better nice one, cheers

-Pending-
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Jun 2006 03:00
I might be missing something but if you're just trying to slow down the mouse speed, why not just multiply it by a decimal like 0.1 or 0.01? Thats usually the generic method of slowing mouse movement/adding sensitivity.

Pincho Paxton
22
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Jun 2006 13:02 Edited at: 3rd Jun 2006 13:03
Do you mean Multiply the Mousex(), Mousey() by 0.1??? What do you multiply? Is there a mouse speed command?

Waltzy
18
Years of Service
User Offline
Joined: 1st Jun 2006
Location: UK Cornwall
Posted: 3rd Jun 2006 14:18
im afraid i dont sunderstand either.

-Pending-
RUCCUS
20
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Jun 2006 16:42 Edited at: 3rd Jun 2006 16:44
Yes, mousemovex() and mousemovey()

Unless thats only DBP, in which case you could still make a function to get the speed based on subtracting the old mouse positions from the new to get the difference.

<EDIT>

Which it looks to be what you've done, the only change I'd make is not to give the absolute of the speed, having negative values is much more useful (so when the value is negative the mouse is moving to the left, and opposite for when its positive, allowing you to turn objects properly). After you've gotten the speed, just multiplty it by some sensitivity and use those two values to rotate the camera/object/whatever.

Login to post a reply

Server time is: 2025-05-25 04:28:05
Your offset time is: 2025-05-25 04:28:05