forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Joystick/analog stick in PSPGL----Cant get it right... Help?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sg57



Joined: 14 Oct 2005
Posts: 154

PostPosted: Tue Aug 08, 2006 8:25 am    Post subject: Joystick/analog stick in PSPGL----Cant get it right... Help? Reply with quote

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!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group