Ejemplo n.º 1
0
        /// <summary>
        /// Restarts the runner
        /// </summary>
        /// <param name="runners">New batch of runners</param>
        /// <param name="seed">Course generation seed</param>
        /// <returns>Executable task</returns>
        public void Restart(List <BaseRunner> runners, ulong seed)
        {
            Gen.Seed = seed;
            Runners  = runners;

            Reset();
            GenerateCourse(2);

            BatchTimer.Start();

            //var pos = Course[0].Flag.Position + new Vector2(30, 30);
            var pos        = new Vector2(1920f / 2f, 1080f / 2f);
            int spawnedcnt = 0;

            foreach (var runner in Runners)
            {
                runner.Position = pos;
                KillAllRunners += runner.Die;
                CallDeferred("add_child", runner);
                //await ToSignal(runner, "ready");
                spawnedcnt++;
                runner.DiedEvent += OnRunnerDied;
            }
            //GD.Print($"Runner count: {Runners.Count}, Spawned: {spawnedcnt}");
        }
Ejemplo n.º 2
0
 private void ShowMessage(string textString)
 {
     messageLabel.Text = textString;
     messageLabel.Show();
     messageTimer.Start();
 }