sg57
Joined: 14 Oct 2005 Posts: 154
|
Posted: Tue Aug 08, 2006 8:25 am Post subject: Joystick/analog stick in PSPGL----Cant get it right... Help? |
|
|
I have 4 variables, per say, I want them to individually to be manipulated for each direction the analog is pointing...
Directions being down/backward, left, right nad forward/up... The original function supplied by the port of nehe tutorials on lesson 10 uses the analog stick, so ive looked there many times... Ive tried this approach, but it just goes everywhere with the slightest tap on the stick:
| Code: |
void joystickMoved (unsigned int buttonMask, int x, int y, int z)
{
if (abs(x) > 200) // dead zone LEFT <------------
{
variablex--;
}
if (abs(y) > 200) // dead zone UP +++++++++++++++
{
variabley--;
}
if (abs(x) < 55) // dead zone RIGHT ------------->
{
variablex++;
}
if (abs(y) < 55) // dead zone DOWN _______________
{
variabley++;
}
}
| Could someone please enlighten me on exactly how to use the analog stick - PSPGL's function for the joystick, since I cant seem to get it right....
Thanks! |
|