неправильный вывод в консоль c#

есть простая незаконченная игра, я делаю схематичную отрисовку карты в консоль, но позиция игрока по у выводится неправильно, вот код:

    using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace csGame
{
    class Program
    {
        public static List<string> Line;
        public static List<List<string>> screen;
        static bool Created;

        static void Main(string[] args)
        {
            Line = new List<string>();
            List<List<string>> screen = new List<List<string>>();
            System.Console.WriteLine("initilazing game");
            Player player = new Player(); System.Console.WriteLine("Player created");
            Enemy enemy = new Enemy(); System.Console.WriteLine("Enemy Created");

            List<int> x = new List<int>(2);
            x.Add(0);// x.Append(0);
            List<int> y = new List<int>(2);
            y.Add(0);// y.Append(0);
            List<string> name = new List<string>(2);
            name.Add(""); name.Append("");
            Console.WriteLine("Created GUI massives");

            player.Position.x = 7;
            player.Position.y = 3;

            System.Console.WriteLine("Hello world!");
            Line.Append("H");
            screen.Append(Line);
            for (int i = 0; i <= 15; i++) Line.Add("H");

            for (int i = 0; i <= 5; i++) {screen.Add(Line); }
                //  System.Console.WriteLine(screen);
                System.Console.WriteLine("type ENTER to start game");
                Console.ReadLine();
                System.Threading.Thread.Sleep(1000);
                Console.Clear();
                System.Console.WriteLine("Instantiating scene");
                System.Threading.Thread.Sleep(1000);
                Console.Clear();

            while (true)
            {

                player.Position = MovePlayer(player.Position);
                Console.WriteLine("x:" + player.Position.x + " y:" + player.Position.y);
                x[0] = player.Position.x;
                y[0] = player.Position.y;
                name[0] = "U";
                Draw(player.Position.x, player.Position.y, "U", screen);
                clearscreen(screen);
            }
        }
        public static void clearscreen(List<List<string>> screens)
        {
            foreach (List<string> s in screens)
            {
                for(int i = 0; i < s.Count; i++)
                {
                    s[i] = "H";
                }
            }
        }
        public static void Draw(int x, int y, string Name, List<List<string>> screens)
        {
            screens[y][x] = Name;

            for (int s = 0; s < screens.Count; s++)
            {
                for(int i = 0; i < screens[s].Count; i++)
                {
                    Console.Write(screens[s][i]);
                }
                Console.WriteLine();
            }
        }

        public struct position
        {
            public int x;
            public int y;
        }
        public struct Player
        {
            public position Position;
        }
        public struct Enemy
        {
            public position _Position;
        }

        static position MovePlayer(position _player)
        {
            System.Console.WriteLine("input WASD to move");
            string Vector = Console.ReadLine();
            Vector = Vector.ToUpper();
            switch (Vector)
            {
                case "A":
                    _player.x--;
                    break;
                case "D":
                    _player.x++;
                    break;
                case "W":
                    _player.y++;
                    break;
                case "S":
                    _player.y--;
                    break;
            }
            return _player;
        }

    }

}

позиция игрока по y выводится на всю ось у: баг


Ответы (0 шт):