Beispiel #1
0
        static private void GameCommand(ConsoleKey key)
        {
            switch (key)
            {
            case ConsoleKey.UpArrow:
                ActionControl.MoveCommand(direction.up);
                break;

            case ConsoleKey.DownArrow:
                ActionControl.MoveCommand(direction.down);
                break;

            case ConsoleKey.RightArrow:
                ActionControl.MoveCommand(direction.right);
                break;

            case ConsoleKey.LeftArrow:
                ActionControl.MoveCommand(direction.left);
                break;

            case ConsoleKey.I:
                gameState = GameState.inventory;
                ViewOnConsole.View(gameState);
                break;
            }
        }
Beispiel #2
0
        static private void InventoryCommand(ConsoleKey key)
        {
            switch (key)
            {
            case ConsoleKey.UpArrow:
                player.inventory.MoveInventory(direction.up);
                break;

            case ConsoleKey.DownArrow:
                player.inventory.MoveInventory(direction.down);
                break;

            case ConsoleKey.RightArrow:
                player.inventory.MoveInventory(direction.right);
                break;

            case ConsoleKey.LeftArrow:
                player.inventory.MoveInventory(direction.left);
                break;

            case ConsoleKey.Enter:
                player.inventory.items[player.inventory.insertPosition].Use();
                break;

            case ConsoleKey.I:
                gameState = GameState.game;
                ViewOnConsole.View(gameState);
                break;
            }
        }
Beispiel #3
0
        static void Main()
        {
            Initialization();

            while (true)
            {
                ViewOnConsole.View(gameState);

                KeybordCommand.DistrubuteCommand();

                Step.Invoke();
            }
        }
Beispiel #4
0
        static void Main()
        {
            Initialization();

            while (true)
            {
                ClearMap();
                FillMap();
                ViewOnConsole.ViewGame();

                KeybordCommand.DistributeCommand(Console.ReadKey().Key);

                //GameReaction();
                Step.Invoke();

                //TODO: переделать
                DungeonRoom.currentDungeonRoom.roomNextSteep.Invoke();
            }
        }