Exemple #1
0
        static void As(Plate[] plates)
        {
            Random random  = new Random();
            int    x       = random.Next(4, 24);
            int    texture = random.Next(0, 3);
            int    y       = 0;

            for (int i = 14; i > 0; i--)
            {
                plates[i] = plates[i - 1];
            }
            Plate plate = new Plate();

            plate.Spawn(x, y, texture);
            plate.Draw();
            plates[0] = plate;
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;
            //строка 120 символов
            //поле 30 символов
            // U+07DB
            bool   flag   = false;
            Random random = new Random();

            Console.Clear();
            Plate[] plates = new Plate[15];
            for (int i = 0; i < 30; i += 2) // заполнение памяти 15 платформ
            {
                int   x       = random.Next(4, 24);
                int   texture = random.Next(0, 3);
                int   y       = i;
                Plate plate   = new Plate();
                plate.Spawn(x, y, texture);
                plates[i / 2] = plate;
            }

            while (true)
            {
                Thread.Sleep(1000);
                Console.Clear();
                flag = !flag;
                for (int i = 0; i < 15; i++)
                {
                    if (flag)
                    {
                        plates[i].Move();
                    }
                    plates[i].MoveXPlate();
                    plates[i].Draw();
                    //plates[i].Intersect();
                }
                if (flag)
                {
                    As(plates);
                }
            }
        }