Example #1
0
    private void spawnJoggers()
    {
        float   place   = Random.value * rdHeight - rdHeight / 2;
        Vector3 spawnPt = new Vector3(spawnPtPad + (rdWidth / 2), place, 0);

        if (Jogger.spawnClock > Jogger.spawnNext)
        {
            Jogger.spawnClock -= Jogger.spawnNext;
            GameObject go = new GameObject();
            go.transform.parent   = enemyFolder.transform;
            go.transform.position = spawnPt;
            Jogger jogger = go.AddComponent <Jogger>();
            if (dropped)
            {
                jogger.init(this, true);
            }
            else
            {
                jogger.init(this, false);
            }
            Jogger.spawnNext = (Jogger.minTimeBase + Jogger.minTimeAggro * aggro) +
                               (Jogger.spreadTimeBase + Jogger.spreadTimeAggro * aggro) *
                               Random.value;
        }
        Jogger.spawnClock += Time.deltaTime;
    }
        //static int _width;
        //static int _height;
        //static Point _target;
        //public struct Point {
        //    public static int x;
        //    public static int y;
        //    public int X;
        //    public int Y;
        //}
        static void Main(string[] args)
        {
            while (true)
            {
                string input = ReadLine();
                _consoleHistory.Add(input);
                input = input.ToLower().Trim();

                if (input == "jog")
                {
                    Jogger.Jog(5, 5);
                    System.Threading.Thread.Sleep(1000);
                    Jogger.Bottom();
                    System.Threading.Thread.Sleep(1000);
                    Jogger.CenterHorizontal();
                    System.Threading.Thread.Sleep(1000);
                    Jogger.CenterVertical();
                    System.Threading.Thread.Sleep(1000);
                    Jogger.End();
                    System.Threading.Thread.Sleep(1000);
                    Jogger.Home();
                    System.Threading.Thread.Sleep(1000);
                    Jogger.Top();
                }

                if (input == "strobe")
                {
                    _backgroundEffects.StrobeRandom(count: 30, new Milliseconds(10));
                }

                if (input == "print")
                {
                    _textPrinter = new TextPrinter("Print a thing");
                    _textPrinter.Print();
                    _textPrinter.Type();
                }

                if (input == "cycle")
                {
                    _backgroundEffects.CycleRandom(new Milliseconds(10));
                }
            }

            //_width = Console.WindowWidth;
            //_height = Console.WindowHeight;

            //Console.BackgroundColor = ConsoleColor.Yellow;
            //Console.Clear();
            //SetTarget(new Random().Next(0, _width), new Random().Next(0, _height));
            //while (true)
            //{

            //    string input = Console.ReadLine();
            //    Fire(input);
            //    ////Speak(input);
            //    //int ceilingX = Console.WindowWidth;
            //    //int ceilingY = Console.WindowHeight;
            //    //Point.x = new Random().Next(0, ceilingX);
            //    //Point.y = new Random().Next(0, ceilingY);

            //    //SetCursor();
            //    //Color();
            //    //Stroke(1);


            //    //System.Threading.Thread.Sleep(5);

            //    //    Color();
            //    //    Stroke(1);

            //    //_width = Console.WindowWidth;
            //    //_height = Console.WindowHeight;

            //    //Point.x = Console.CursorLeft;
            //    //Point.y = Console.CursorTop;
            //    ////object character = Console.Read();
            //    ////object key = Console.ReadKey();
            //    //string input = Console.ReadLine().ToLower();
            //    //if (input == "d")
            //    //{
            //    //    Speak($"Width: {_width}");
            //    //    Speak($"Height: {_height}");
            //    //    Speak($"Point: {Point.x}:{Point.y}");
            //    //    //Speak($"key: { key }");
            //    //    //Speak($"character: { character }");
            //    //}
            //    ////NOTE: sample input color x y
            //    //if (input.StartsWith("color"))
            //    //{
            //    //    SetCursor(int.Parse(input.Split(' ')[1]), int.Parse(input.Split(' ')[2]));
            //    //    Color();
            //    //    Stroke(1);
            //    //}
            //}
        }