I am new to C Sharp and am writing a game with the XNA Framework.
I'm trying to set variables for buttons on an XBox 360 controller, so I can reconfigure the game functions of the buttons in one place and not change the direct links to buttons everywhere.
So, if I want to assign an attack button, instead:
if (gamePadState.IsButtonDown(Buttons.B)
{
// do game logic
}
I want to do this:
if (gamePadState.IsButtonDown(MyAttackButton)
{
// do game logic
}
Any ideas? I am sure this is a very simple solution, but I tried several approaches and no one has worked yet. Thank!
source
share