Example #1
0
        private IEnumerator Sequence()
        {
            Vector2 start = this.Position;

            for (; ;)
            {
                while (!this.HasPlayerRider() && !SyncFlag)
                {
                    yield return(null);
                }
                // Signaling other movers
                SyncFlag = true;
                // End signaling other movers
                ZipMoverSoundController.PlaySound(this.ColorCode, ZipMoverSoundController.SoundType.NonReturning, this);
                Input.Rumble(RumbleStrength.Medium, RumbleLength.Short);
                this.StartShaking(0.1f);
                yield return(0.1f);

                SyncFlag = false;
                this.streetlight.SetAnimationFrame(3);
                this.StopPlayerRunIntoAnimation = false;
                float at = 0f;
                while (at < 1f)
                {
                    yield return(null);

                    at           = Calc.Approach(at, 1f, 2f * Engine.DeltaTime * speedMultiplier);
                    this.percent = Ease.SineIn(at);
                    Vector2 to;
                    if (firstDirection)
                    {
                        to = Vector2.Lerp(start, this.target, this.percent);
                    }
                    else
                    {
                        to = Vector2.Lerp(this.target, start, this.percent);
                    }
                    this.ScrapeParticlesCheck(to);
                    bool flag = this.Scene.OnInterval(0.1f);
                    if (flag)
                    {
                        this.pathRenderer.CreateSparks();
                    }
                    this.MoveTo(to);
                    to = default(Vector2);
                }
                this.StartShaking(0.2f);
                Input.Rumble(RumbleStrength.Strong, RumbleLength.Medium);
                this.SceneAs <Level>().Shake(0.3f);
                this.StopPlayerRunIntoAnimation = true;
                this.streetlight.SetAnimationFrame(2);
                yield return(0.5f);

                ZipMoverSoundController.StopSound(this.ColorCode, ZipMoverSoundController.SoundType.NonReturning);
                this.StopPlayerRunIntoAnimation = false;
                this.streetlight.SetAnimationFrame(1);
                this.firstDirection = !this.firstDirection;
            }
        }
Example #2
0
 public override void Removed(Scene scene)
 {
     scene.Remove(this.pathRenderer);
     this.pathRenderer = null;
     SyncFlag          = false;
     ZipMoverSoundController.StopSound(ColorCode, ZipMoverSoundController.SoundType.NonReturning);
     base.Removed(scene);
 }