Esempio n. 1
0
    private void CreateCommand()
    {
        _playerCommand = new CommandDelegate();

        _playerCommand.Add("move_up", new CommandPlayerMove(this, Vector2.up));
        _playerCommand.Add("move_left", new CommandPlayerMove(this, Vector2.left));
        _playerCommand.Add("move_down", new CommandPlayerMove(this, Vector2.down));
        _playerCommand.Add("move_right", new CommandPlayerMove(this, Vector2.right));
        _playerCommand.Add("jump", new CommandPlayerJump(this));
        _playerCommand.Add("sprint", new CommandPlayerSprint(this));
        _playerCommand.Add("drop_item", new CommandCallback(delegate { DropItem(_pickedItemContainer); }));
    }
Esempio n. 2
0
        public PlayerInterface(Player player) : base()
        {
            _player = player;

            _itemSelect    = new ItemSelect(this);
            _inventoryMenu = new InventoryMenu(this);

            _playerCommand = new CommandDelegate();

            _playerCommand.Add("inventory", new CommandCallback(delegate
            {
                if (_inventoryMenu.activated)
                {
                    _inventoryMenu.RequestTerminate();
                }
                else
                {
                    AddSubLoopFlow(_inventoryMenu);
                }
            }));
        }