int BUTTONS[9];
double XAXIS;
double YAXIS;
void SetupPad() {
int i;
for (i=0;i<8;i++) {
BUTTONS[i]=GetJoystick1Button(i); }
XAXIS=GetJoystick1Axis(0);
YAXIS=GetJoystick1Axis(1);
}
#define BTN_A BUTTONS[0]
#define BTN_B BUTTONS[1]
#define BTN_X BUTTONS[2]
#define BTN_Y BUTTONS[3]
#define BTN_L BUTTONS[4]
#define BTN_R BUTTONS[5]
#define BTN_SEL BUTTONS[6]
#define BTN_START BUTTONS[7]
SetupPad();
if (BTN_A) {
//Jump here }
if (BTN_X) {
//Shoot Here }
int OFFSET=10000;
int BUTTONS[9];
double XAXIS;
double YAXIS;
void SetupPad() {
int i;
for (i=0;i<8;i++) {
BUTTONS[i]=GetJoystick1Button(i); }
XAXIS=GetJoystick1Axis(0);
YAXIS=GetJoystick1Axis(1);
}
if (XAXIS>OFFSET) {
x+=5; }
else if (XAXIS<-OFFSET) {
x-=5; }
char*key=GetKeyState();
ButtonJump=(GetJoystick1Button(0)||key[KEY_SPACE]);
Users browsing this forum: No registered users and 1 guest