Clash
Joined: 27 Jun 2006 Posts: 182
|
Posted: Mon Apr 21, 2008 12:23 pm Post subject: Racing game using mouse opposed to arrow keys |
|
|
Hello. There's something wrong with my keyboard or motherboard which makes it lag in games. I've ordered a new usb keyboard to try and fix it, but in the mean time i want to try something.
I want to use my mouse to play a racing game. drag the mouse left to turn left, and drag right to turn right, lbutton as up and rbutton as down. But i'm not finding it that easy. This is what i have. It 'kinda' works but if you drag the mouse too far right, for example, you can't turn right any more. If i mousemove to center, it'd turn left.
| Code: |
settimer, turn, 100
^k::exitapp
;lbutton::send, {up}
;rbutton::send, {down}
turn:
mousegetpos, x_ax_in
if(x_ax_in = x_ax){
send, {left up}
send, {right up}
}
if(x_ax_in > x_ax){
send, {left up}
send, {right down}
mousegetpos, x_ax
x_ax_in =
} else {
if (x_ax_in < x_ax){
send, {right up}
send, {left down}
mousegetpos, x_ax
x_ax_in =
}
}
return |
_________________
 |
|