Ejemplo n.º 1
0
        public static void CreateRock()
        {
            int xCoord = generator.Next(Console.WindowWidth);
            int Type = generator.Next(RocksType.Length);

            //Generates the size of the rock(1,2 or 3).
            int size = generator.Next(1,4);
            int color=generator.Next(1,16);

            //Creates rocks with count [size] and concatenates them(xCoord+i).
            for (int i = size-1; i >=0; i--)
            {
                if (xCoord + i <= Console.WindowWidth-1 )
                {

                    Rocks rock = new Rocks(new Point(xCoord+i, 0), RocksType[Type], (ConsoleColor)color);
                    rocks.Add(rock);
                }
            }
            
        }
Ejemplo n.º 2
0
 public static void DrawRock(Rocks rock)
 {
     Console.SetCursorPosition(rock.location.X, rock.location.Y);
     Console.ForegroundColor = rock.color;
         Console.Write(rock.type);
     
 }