Пример #1
0
        public TKButtons CurrentState(PlayerIndex index)
        {
            //switch(
            TKButtons    state   = TKButtons.None;
            GamePadState gpState = GamepadExtended.Current(index).CurrentState;

            if (gpState.IsButtonDown(Buttons.A))
            {
                state = state | TKButtons.Green;
            }
            if (gpState.IsButtonDown(Buttons.Y))
            {
                state = state | TKButtons.Yellow;
            }
            if (gpState.IsButtonDown(Buttons.B))
            {
                state = state | TKButtons.Red;
            }
            if (gpState.IsButtonDown(Buttons.X))
            {
                state = state | TKButtons.Blue;
            }

            return(state);
        }
 public bool IsDown(PlayerIndex index, TKButtons buttons)
 {
     throw new NotImplementedException();
 }
Пример #3
0
        public bool IsDown(PlayerIndex index, TKButtons buttons)
        {
            TKButtons currentState = CurrentState(index);

            return((currentState & buttons) == buttons);
        }