Example #1
0
        public Tutorial(World world)
        {
            Orbits     = Empty;
            this.world = world;
            key_player = ActiveKeys[0];

            trigger_die_restart = () => { if (phase != Phases.ENDROUND)
                                          {
                                              EndRound();
                                          }
            };
            HEADS[key_player].OnDie += trigger_die_restart;

            Standard.Add(new Orbit(.1f, .2f, 1f / 13));
            Standard.Add(new Orbit(.367f, .2f, 1f / 13));
            Standard.Add(new Orbit(.633f, .2f, 1f / 13));
            Standard.Add(new Orbit(.9f, .2f, 1f / 13));
            Standard.Add(new Orbit(2f / 9, .5f, 1f / 13));
            Standard.Add(new Orbit(.5f, .5f, 1f / 13));
            Standard.Add(new Orbit(7f / 9, .5f, 1f / 13));
            Standard.Add(new Orbit(.1f, .8f, 1f / 13));
            Standard.Add(new Orbit(.633f, .8f, 1f / 13f));
            Standard.Add(new Orbit(.9f, .8f, 1f / 13));

            new Thread(() => {
                Thread.CurrentThread.Name = "Tutorial_Manager";
                MVP.SetText("Tutorial");
                MVP.Hide();
                SpinWait.SpinUntil(() => step == 1 || !ApplicationRunning);
                step  = 0;
                stage = 2;
                EndRound();

                SpinWait.SpinUntil(() => step == 23 || !ApplicationRunning);
                step  = 0;
                stage = 3;
                EndRound();

                SpinWait.SpinUntil(() => step > 1 || !ApplicationRunning);
                step  = 0;
                stage = 4;
                EndRound();

                SpinWait.SpinUntil(() => step == 4 || !ApplicationRunning);
                step  = 0;
                stage = 5;
                EndRound();

                SpinWait.SpinUntil(() => step == 15 || !ApplicationRunning);
                step        = 0;
                stage       = 6;
                bot1.OnDie += () => step++;
                EndRound();

                SpinWait.SpinUntil(() => step == 13 || !ApplicationRunning);
                step  = 0;
                stage = 7;
                EndGame();
            }).Start();
        }
Example #2
0
 public virtual void StartRound()
 {
     OnStartRound?.Invoke();
     Clear();
     StartRoundTime = (int)Math.Round(Math.PI / speed * 72 * 3 * SZR);
     StartRotation  = 2D * Math.PI * R.NextDouble();
     MVP.Hide();
     Program.Map.spawnOrb();
     Sort();
     OnRevive?.Invoke();
     if (HEADS[ActiveKeys[0]].Points > 0)
     {
         Leader = ActiveKeys[0];
     }
     phase = Phases.STARTROUND;
 }