Okay, new idea: a joystick's X/Y detection is based on how much it's handle (or stick) is offset from the centerpoint, right? So in other words, graphically speaking:
/---\ /---\ /---\ /---\ ./-o-\
| o | o.+.||..+.o|..+..||..+..|
\---/ \---/ \---/ \-o-/ .\---/
|X=0|X=-1|X=1 |X=0 | X=0
|Y=0|Y=0 |Y=0 |Y=-1| Y=1
The handle is represented by "o" and the center point is represented by "+" in my diagram. (Yeah I know it looks bad, but there's only so much you can do with text!) Now, imagine that the handle is the mouse. When your game loop starts, you set the centerpoint using MoveMouse, then use the same principle shown above. Your code might look something like this:
You may have to reverse the order of "centerx/y - (MouseX/Y() / sensitivity)" to "(MouseX/Y() / sensitivity) - centerx/y", I'm not sure. If this doesn't work, then I'm out of ideas - hey, I'm only 14, how much can you expect? Anyway, best of luck with the competition - L8r!
/---\ /---\ /---\ /---\ ./-o-\
| o | o.+.||..+.o|..+..||..+..|
\---/ \---/ \---/ \-o-/ .\---/
|X=0|X=-1|X=1 |X=0 | X=0
|Y=0|Y=0 |Y=0 |Y=-1| Y=1
The handle is represented by "o" and the center point is represented by "+" in my diagram. (Yeah I know it looks bad, but there's only so much you can do with text!) Now, imagine that the handle is the mouse. When your game loop starts, you set the centerpoint using MoveMouse, then use the same principle shown above. Your code might look something like this:
centerx = GraphicsWidth() / 2 centery = GraphicsHeight() / 2 sensitivity = 100;Raise this to decrease sensitivity, lower it to increase it ;The "MouseStick" (har har) test/update code ;jx & jy are the replacement vars for JoyX() & JoyY(), of course jx = centerx - (MouseX() / sensitivity) jy = centery - (MouseY() / sensitivity)
You may have to reverse the order of "centerx/y - (MouseX/Y() / sensitivity)" to "(MouseX/Y() / sensitivity) - centerx/y", I'm not sure. If this doesn't work, then I'm out of ideas - hey, I'm only 14, how much can you expect? Anyway, best of luck with the competition - L8r!