space war input problem

space war don't respond on my keyboard actions
[47 byte] By [Mikx] at [2008-2-23]
# 1
That's because it's expecting a wired controller. You'd have to change it to use the keyboard. Maybe I'll look into doing that.
JimPerry at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 2
good thing I bought a wired controller from someone
aka_Big_Wurm at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 3

Space war works with the gamepad only. Since XNA framework

However you should be able to add in keyboard control since you have all the source. Start in gamepadhelper.cs - there is a #define which enables some keyboard, though I'm not sure exactly how well it works.

TheZMan at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 4
uncommenting the #define seems to work with movement and fire keys (A - fire; S, D - rotate; W, X - forward and reverse thrust; B - hyperspace, although this does it for both ships)
JimPerry at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 5
Yeah it looks like it was added as a demo rather than as something playable. But its a starting point.
TheZMan at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 6

To move ships independently I've modified GamePadHelper.cs file to map different keys for other players:

// Setup Dictionary with defaults

if (player.ToString() == "One")

{

// Here are the original keys for first player

keyMapping.Add(GamePadKeys.Start, Keys.Home);

...

keyMapping.Add(GamePadKeys.ThumbstickRightYMax, Keys.I);

}

else

{

// Here goes keys for second player

keyMapping.Add(GamePadKeys.Start, Keys.NumPad0);

...

}

Pucis at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 7

You can find a work around here.

http://www.xnaspot.com/Tutorial_GettingStarted.aspx

andy0482 at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 8
My 360 controller works great. Vibration is a little too strong though.
Blisardo at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 9

Hey is there any way to get a normal windows/pc joystick/gamepad working with xna ?

invadererik at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...
# 10

No. Well nothing official.

In windows you could try adding the MDX 1.1 Directt Input assemblies - but I wouldn't be surprised if that fails

Or you could write your own managed DirectInput wrapper

Or you could write your own Raw windows message wrapper and pick up the gamepad messages that way.

But unless you earn $2000 an hour I imagine its probably cheaper in the long run to go and buy a couple of xbox controllers :-)

TheZMan at 2007-8-31 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Framework...