Пример #1
0
        public void init()
        {
            keyMoveForward = new KeyBind(this, Key.W);
            keyMoveBackward = new KeyBind(this, Key.S);
            keyMoveLeft = new KeyBind(this, Key.A);
            keyMoveRight = new KeyBind(this, Key.D);

            keyRotateLeft = new KeyBind(this, Key.Q);
            keyRotateRight = new KeyBind(this, Key.E);
            keyRotateUp = new KeyBind(this, Key.R);
            keyRotateDown = new KeyBind(this, Key.F);

            keyAttack = new KeyBind(this, Key.Space);

            leftClick = new KeyBind(this, MouseButton.Left);
            rightClick = new KeyBind(this, MouseButton.Right);

            keyEscape = new KeyBind(this, Key.Escape);
        }
Пример #2
0
 private bool isKeyDown(KeyBind keyBind, Game game)
 {
     return game.Focused ? (keyBind.isKey ? keyboardState.IsKeyDown(keyBind.kId) : mouseState.IsButtonDown(keyBind.mbId)) : false;
 }
Пример #3
0
 public void Add(KeyBind keyBind)
 {
     keyBindList.Add(keyBind);
 }