Ignoring button?
Posted: Thu Sep 18, 2008 3:41 am
This piece of code is driving me mad. I'm trying to create a simple bat and ball game to get to grips with thie code. I am not a noob coder, but this is the first time i've tried coding for the wii. I'm using the latest devkitpro with the programmers notepad IDE and GRRLIB librarys.
This snippet of code brings up a continue screen, but i can't for the life of me get it to respond to WPAD_BUTTON_UP, DOWN or HOME. I have all relevent librarys included.
if (score == 0) // upon losing all lives
{
int boo = 1;
while (boo==1)
{
pressed = WPAD_ButtonsDown(0);
GRRLIB_FillScreen(rainbow);
GRRLIB_Printf(lossx, lossy, tex_font1, 0xffffffff, 2, "You Lose, HA! Continue? up=y, down=n");
if ( pressed & WPAD_BUTTON_UP ) //restart game if press up
{
score = 5;
boo = 0;
}
if (pressed & WPAD_BUTTON_DOWN) exit(0); //end game if press down
if ( pressed & WPAD_BUTTON_HOME ) exit(0);
GRRLIB_Render();
}
startGame();
boo=1;
}
Can anybody see any problems with this code? I sure can't...
Thanks,
Sharon
This snippet of code brings up a continue screen, but i can't for the life of me get it to respond to WPAD_BUTTON_UP, DOWN or HOME. I have all relevent librarys included.
if (score == 0) // upon losing all lives
{
int boo = 1;
while (boo==1)
{
pressed = WPAD_ButtonsDown(0);
GRRLIB_FillScreen(rainbow);
GRRLIB_Printf(lossx, lossy, tex_font1, 0xffffffff, 2, "You Lose, HA! Continue? up=y, down=n");
if ( pressed & WPAD_BUTTON_UP ) //restart game if press up
{
score = 5;
boo = 0;
}
if (pressed & WPAD_BUTTON_DOWN) exit(0); //end game if press down
if ( pressed & WPAD_BUTTON_HOME ) exit(0);
GRRLIB_Render();
}
startGame();
boo=1;
}
Can anybody see any problems with this code? I sure can't...
Thanks,
Sharon