Ejemplo n.º 1
0
        static OrbitalRegistry()
        {
            Define("prism", o => {
                var orbital = new Prism();
                o.Area.Add(orbital);

                return(orbital);
            });

            Define("goo", o => {
                var orbital = new Orbital();
                o.Area.Add(orbital);

                var g = new ScalableSliceComponent("items", "bk:goo")
                {
                    ShadowZ = 2
                };

                orbital.AddComponent(g);
                g.AddShadow();
                g.SetOwnerSize();

                orbital.AddComponent(new CircleBodyComponent(0, 0, 6, BodyType.Dynamic, true));

                orbital.OnCollision += (or, e) => {
                    if (e is Projectile p && p.Owner != orbital.Owner)
                    {
                        p.Break();
                    }
                };

                return(orbital);
            });
Ejemplo n.º 2
0
        public override void AddComponents()
        {
            base.AddComponents();

            var s = new ScalableSliceComponent("items", "bk:burning_king_sword")
            {
                ShadowZ = 2
            };

            AddComponent(s);
            s.AddShadow();

            AlwaysActive  = true;
            AlwaysVisible = true;

            AddComponent(new RectBodyComponent(0, 0, 11, 26, center: true)
            {
                KnockbackModifier = 0
            });

            SetMaxHp(5);

            AddComponent(new OrbitalComponent {
                Radius = 32
            });

            RemoveTag(Tags.LevelSave);

            s.Scale.X = 0;
            s.Scale.Y = 0;

            Tween.To(1, s.Scale.X, x => s.Scale.X = x, 0.4f, Ease.QuadOut);
            Tween.To(1, s.Scale.Y, x => s.Scale.Y = x, 0.4f, Ease.QuadOut);

            Height = 26;
            // Width = 11;
        }