Welcome! Log In Create A New Profile

Advanced

Nunchuk?

Posted by ShadowSpace 
Nunchuk?
October 23, 2010 02:46PM
How do I use the Nunchuk in my games?
Re: Nunchuk?
October 23, 2010 02:50PM
Quote
ShadowSpace
How do I use the Nunchuk in my games?

Try this:
Quote

expansion_t e;
int nx;
int ny;

WPAD_Expansion(WPAD_CHAN_0, &e);
if(e.type != WPAD_EXP_NUNCHUK)
{
iprintf("Nunchuk not attached to Wiimote 0");
}
nx = e.nunchuk.js.pos.x - e.nunchuk.js.center.x;
ny = e.nunchuk.js.pos.y - e.nunchuk.js.center.y;

nx and ny should contain valid values for the nunchuk's joystick. Check the "expansion_t" structure in libogc's header files. All the keys & controls for the expansion devices (like the nunchuk) should be right there.

Of course, be sure to call WPAD_Init() before attempting to use this code in your application.
Re: Nunchuk?
October 23, 2010 08:16PM
depends on what you want to do with it...

I have a function i made that i use in all my games that does all my getinputs and it's adjustable for whatever you want... nothing special, just to make things easier for me.

What kind of control will you be doing with your nunchuck?
Sorry, only registered users may post in this forum.

Click here to login