Sign in to follow this  

xna for PC and gamepad

This topic is 2850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I wish (to try) to make a mmorpg game ( like many other exist already). I wish to make the client free, even open source, the server side not, it will contain non public code. I wish to earn money from selling various items used in game. Better swords, armor and so on. As I know I can use the Microsoft XNA Game Studio 3.1 with C# Express Edition 2008 for this scope. So: just PC platform not XBox or anything else. My first question it is legal this for client development? -how about the server development the C# Express 2008? And a technical question: Here is a tutorial: http://msdn.microsoft.com/en-us/library/bb975644.aspx Download GoingBeyond4_Tutorial_Sample.zip. Downloaded and started to "play" on PC. I couldn't because I haven't a game pad. I went to shop and bought one: Canyon CNG-GP2. Installed the driver, and at control panel made a test. It works fine. I have restarted my PC, after start again the Microsoft XNA Game Studio 3.1 debug, I still see I can't play. in the code: protected void UpdateInput() { // Get the game pad state. GamePadState currentState = GamePad.GetState(PlayerIndex.One); if (currentState.IsConnected) { .... } else { Console.WriteLine("Not connected the gamepad:" + currentState); } ..... } And at output I see: "Not connected the gamepad:{IsConnected:False}" - and at windows control panel I can test my game pad...works perfectly. What to do? :)

Share this post


Link to post
Share on other sites
As far as I know there are no restrictions on using XNA GS or C# Express for commercial PC development. But as always if you're really concerned you should consult a lawyer.

The XNA GamePad class only works for devices supporting XInput, which is really just the Xbox 360 controller. I'd recommend getting one since that's what most of your customers would use. For other gamepads, you can use DirectInput. SlimDX has a DirectInput wrapper, or you can use something like this.

Share this post


Link to post
Share on other sites
namespace Microsoft.Xna.Framework.Input
{
// Summary:
// Allows retrieval of user interaction with an Xbox 360 Controller and setting
// of controller vibration motors. Reference page contains links to related
// code samples.
public static class GamePad


Now I see :) Thanks for help. Trying with the recomandated library...

Share this post


Link to post
Share on other sites

This topic is 2850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this