Esempio n. 1
0
        private InputManager(Game game)
            : base(game)
        {
            KHit = new Key();
            KHit.SetActivator(KeyboardDefault_Hit);
            KJump = new Key();
            KJump.SetActivator(KeyboardDefault_Jump);
            KInteract = new Key();
            KInteract.SetActivator(KeyboardDefault_Interact);
            KUsePotion = new Key();
            KUsePotion.SetActivator(KeyboardDefault_UsePotion);
            KInventory = new Key();
            KInventory.SetActivator(KeyboardDefault_Inventory);
            KQuit = new Key();
            KQuit.SetActivator(KeyboardDefault_Quit);

            KMove = new DirectionInput();
            KMove.SetActivator(KeyboardDefault_Move);

            _inputList.Add(KHit);
            _inputList.Add(KJump);
            _inputList.Add(KInteract);
            _inputList.Add(KUsePotion);
            _inputList.Add(KMove);
            _inputList.Add(KInventory);
            _inputList.Add(KQuit);

            foreach (InputKey ik in _inputList)
            {
                ik.SetMode(_defaultMode);
            }
        }
Esempio n. 2
0
 public void RegisterKey(String name, TStick binding)
 {
     DirectionInput k = new DirectionInput();
     k.SetActivator(binding);
     _keys.Add(name, k);
 }