示例#1
0
        static void Main(string[] args)
        {
            #region Maps
            DungeonFloor[] DungeonFloors = new DungeonFloor[]
            {
                new DungeonFloor(new char[, ]
                {
                    { 'H', 'M', 'I', '-', 'B' },
                    { '-', 'I', 'O', 'M', '-' },
                    { '-', 'M', 'B', 'H', 'I' },
                    { 'I', '-', 'M', 'E', 'M' },
                    { 'I', '-', 'M', '-', 'B' }
                }),
                new DungeonFloor(new char[, ]
                {
                    { 'H', 'O', '-', '-', '-' },
                    { '-', 'O', '-', '-', '-' },
                    { '-', 'O', 'O', 'H', '-' },
                    { '-', 'O', '-', '-', '-' },
                    { '-', '-', '-', 'O', '-' }
                })
            };
            #endregion


            Player player = new Player(150, 70)
            {
                Position = new Vector2Int(2, 0)
            };
            Dungeon dungeon = new Dungeon(DungeonFloors);

            ConsoleKeyInfo input;

            do
            {
                Console.Clear();
                Console.WriteLine(player);
                Console.WriteLine("Etage " + dungeon.Floor);
                Console.WriteLine("Appuyex sur \"I\" pour ouvrir l\'inventaire");
                dungeon.DrawMap(player.Position);

                input = Inputs(player, dungeon);
            } while (input.Key != ConsoleKey.Escape);
        }
示例#2
0
        static void Main(string[] args)
        {
            #region Maps
            DungeonFloor[] DungeonFloors = new DungeonFloor[]
            {
                new DungeonFloor(new char[, ]
                {
                    { '-', 'M', 'I', '-', 'B' },
                    { '-', 'I', '-', 'M', '-' },
                    { 'S', 'M', 'B', 'M', 'I' },
                    { 'I', '-', 'M', 'E', 'M' },
                    { 'I', '-', 'M', '-', 'B' }
                }),
                new DungeonFloor(new char[, ]
                {
                    { '-', '-', '-', '-', '-' },
                    { '-', '-', '-', '-', '-' },
                    { '-', '-', '-', '-', '-' },
                    { '-', '-', '-', '-', '-' },
                    { '-', '-', '-', '-', '-' }
                })
            };
            #endregion

            Player player = new Player();
            player.Position = new Vector2Int(2, 0);

            Dungeon dungeon = new Dungeon(DungeonFloors);

            ConsoleKeyInfo input;

            do
            {
                Console.Clear();
                dungeon.DrawMap(player.Position);
                Console.WriteLine("Floor " + dungeon.Floor);

                input = Inputs(player, dungeon);
            } while (input.Key != ConsoleKey.Escape);
        }