Beispiel #1
0
        public override void Update(float dt)
        {
            base.Update(dt);

            if (!did && triggered)
            {
                Camera.Instance.Shake(0.5f);
                t += dt;

                if (t >= 1f)
                {
                    did = true;

                    var torches = GetComponent <RoomComponent>().Room.Tagged[Tags.Torch];
                    var target  = new Vector2(CenterX, Y - 16);

                    foreach (var t in torches)
                    {
                        var tr = (Torch)t;

                        tr.XSpread = 1;
                        tr.On      = true;
                        tr.Target  = target;
                    }

                    Timer.Add(() => {
                        foreach (var t in torches)
                        {
                            t.Done = true;
                        }
                    }, 1f);

                    Timer.Add(() => {
                        var bk = new entity.creature.bk.BurningKnight();
                        Area.Add(bk);
                        bk.Center = target;

                        Camera.Instance.Shake(10);

                        foreach (var t in torches)
                        {
                            t.Done = true;
                        }

                        Done = true;
                    }, 2f);
                }
            }
        }
        private void SetupSpawn()
        {
            busy = true;

            var torches = GetComponent <RoomComponent>().Room.Tagged[Tags.Torch];

            target = new Vector2(CenterX, Y - 4);

            foreach (var t in torches)
            {
                var tr = (Torch)t;

                tr.XSpread = 1;
                tr.On      = true;
                tr.Target  = target;
            }

            Timer.Add(() => {
                var bk = new entity.creature.bk.BurningKnight();
                Area.Add(bk);
                bk.Center = target.Value;

                Camera.Instance.Targets.Clear();
                Camera.Instance.Follow(bk, 0.1f);

                Timer.Add(() => {
                    ((InGameState)Engine.Instance.State).ResetFollowing();
                }, 2f);

                Camera.Instance.Shake(10);

                foreach (var t in torches)
                {
                    t.Done = true;
                }

                Done = true;
            }, 2f);
        }