Welcome to Darren Sim's Playpans Sign in | Join | Help

Mapping the Keys in XNA Spacewar StarterKit

If you were wondering if the Spacewar StarterKit in XNA Game Studio Express only supports the XBOX 360 USB Controller (since I've been using it to demo all the time), it's NOT TRUE!

Guess what, you can actually make use of the PC keyboard to control the starterkit too! Infact, you can even map the Keys of the player one and two to whatever you want!

If you actually look into the solution exlorer, you'd notice that there's this file "settings.xml". All you need to do is to open that configuration file and lookout for the "<Player1Start>" tag and that's where all the keyboard mappings are.

Following's my config that I've set for my XNA Game. Smile

<Player1Start>LeftControl</Player1Start>
<
Player1Back>LeftShift</Player1Back>
<
Player1A>V</Player1A>
<Player1B>G</Player1B>
<
Player1X>F</Player1X>
<
Player1Y>T</Player1Y>
<Player1ThumbstickLeftXmin>J</Player1ThumbstickLeftXmin>
<
Player1ThumbstickLeftXmax>D</Player1ThumbstickLeftXmax>
<
Player1ThumbstickLeftYmin>S</Player1ThumbstickLeftYmin>
<
Player1ThumbstickLeftYmax>W</Player1ThumbstickLeftYmax>
<
Player1Left>J</Player1Left>
<
Player1Right>D</Player1Right>
<
Player1Down>S</Player1Down>
<
Player1Up>W</Player1Up>
<
Player1LeftTrigger>Q</Player1LeftTrigger>
<
Player1RightTrigger>E</Player1RightTrigger>

<Player2Start>RightControl</Player2Start>
<
Player2Back>RightShift</Player2Back>
<
Player2A>A</Player2A>
<
Player2B>B</Player2B>
<
Player2X>X</Player2X>
<
Player2Y>Y</Player2Y>
<
Player2ThumbstickLeftXmin>Left</Player2ThumbstickLeftXmin>
<
Player2ThumbstickLeftXmax>Right</Player2ThumbstickLeftXmax>
<
Player2ThumbstickLeftYmin>Down</Player2ThumbstickLeftYmin>
<
Player2ThumbstickLeftYmax>Up</Player2ThumbstickLeftYmax>
<
Player2Left>Left</Player2Left>
<
Player2Right>Right</Player2Right>
<Player2Down>Down</Player2Down>
<
Player2Up>Up</Player2Up>
<
Player2LeftTrigger>Home</Player2LeftTrigger>
<
Player2RightTrigger>End</Player2RightTrigger>

Well, of course, in the starter kit, there's no config menu option. So if someone might want to develop that, it'd be really awesome! Stick out tongue

I might develop that and paste the code here. So stay tunned! [:0]

Published Tuesday, April 24, 2007 5:39 AM by darren.sim
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required)