Page 1 of 1

GetJoystick1Button

PostPosted: Sun Aug 05, 2012 1:55 pm
by erfan71
is anybody know about Joystick?

i want to create my game for Windows and I want to use Controller?
(Xbox 360 Controller for Windows)

how can i do this?

i think in Doc doesn't write any things ?

Re: GetJoystick1Button

PostPosted: Sun Aug 05, 2012 2:04 pm
by erfan71
excuse me .
i found this@@

Re: GetJoystick1Button

PostPosted: Mon Aug 06, 2012 12:53 am
by Hblade
First you want to get the joystick Axis.
Code: Select all
double XAXIS=GetJoysitck1Axis(0);
double YAXIS=GetJoysitck1Axis(1);


now you want to get the button inputs
Code: Select all
int BUTTON[15];
int i;

for(i=0;i<14;i++)
{
BUTTON[i]=GetJoystick1Button(i);
}


Now to use the button (Find the button with trial and error), use this for example, when the A is pressed:
Code: Select all
if(BUTTON[2])
{
x+=5;
}


now when you press one of the buttons (not sure which one), the player will move 5 pixels.

NOTE:
All of this must be in Draw Actor.

Re: GetJoystick1Button

PostPosted: Thu Aug 09, 2012 5:42 pm
by erfan71
so so thanks