7
\$\begingroup\$

Does anybody know how to do this? I have been trying to figure this out with no luck.

\$\endgroup\$
  • \$\begingroup\$ Wired or wireless? \$\endgroup\$ – Chris Simmons Dec 9 '10 at 5:26
  • \$\begingroup\$ multiple wireless \$\endgroup\$ – Egon Dec 13 '10 at 9:51
5
\$\begingroup\$

This? I think the GamePad stuff works on Windows last time I tried it.

\$\endgroup\$
11
\$\begingroup\$

It should work pretty easy. I'm using an xbox 360 controller plugged into my windows machine as my main gaming controller, and to make an XNA project use it all I had to do was:

GamePadState gamepadState = GamePad.GetState(PlayerIndex.One);

float movement = gamePadState.ThumbSticks.Left.X * MoveStickScale;

if (Math.Abs(movement) < 0.5f)
                movement = 0.0f;
if (gamePadState.IsButtonDown(Buttons.DPadLeft)){
                //do something
}
if (gamePadState.IsButtonDown(Buttons.LeftShoulder){
                //do something else
}

and so on. Have you tried testing that the 360 controller works properly with your machine? Like, with other programs/games? Maybe you've just got a driver problem, but I think windows vista and 7 have the 360 drivers by default. (I'm using XP, had to install them)

Try looking at these code samples: http://create.msdn.com/en-US/education/catalog/sample/platformer

http://create.msdn.com/en-US/education/catalog/sample/input_sequence_sample

\$\endgroup\$
1
\$\begingroup\$

You need the "XBox Controller For Windows". As far as I know the controller itself is the same, however, you get an adapter that can be used with any XBox controller device. Either that, or the device just ships with the driver CD.

I would go with Zaphod42's advice (just plug the thing in if it's a standard USB device); and if that doesn't work order one online.

Not 100% sure because I don't own an XBox.

\$\endgroup\$
0
\$\begingroup\$

You need one of the Microsoft Xbox 360 Wireless Gaming Receivers for the wireless pads.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.