예제 #1
0
        public override void AddComponents()
        {
            base.AddComponents();

            AlwaysActive = true;

            Width  = 5;
            Height = 5;

            AddComponent(new RandomFrameComponent("splash_particle")
            {
                Tint = new Color(Color.R, Color.G, Color.B, 0.8f)
            });

            AddComponent(new ShadowComponent(RenderShadow));
            AddComponent(new ZComponent());

            var body = new CircleBodyComponent(0, 0, 4);

            AddComponent(body);

            var f = Rnd.Float(60, 90);
            var a = Rnd.AnglePI();

            body.Body.LinearVelocity = new Vector2((float)Math.Cos(a) * f, (float)Math.Sin(a) * f);
            zv = Rnd.Float(1, 3);
        }
예제 #2
0
        public override void AddComponents()
        {
            base.AddComponents();

            var b = new CircleBodyComponent(0, 0, 8);

            AddComponent(b);

            b.Body.Restitution = 1;
            b.Body.Friction    = 0;
            b.Body.Mass        = 100000f;

            var a = new AnimationComponent("rolling_spike");

            AddComponent(a);

            AlwaysActive = true;
            a.OriginY   *= 0.5f;

            AddComponent(new ShadowComponent());
        }
예제 #3
0
        protected override void SetStats()
        {
            base.SetStats();

            if (jointTexture == null)
            {
                var anim = Animations.Get("maneater_stem");

                jointTexture = anim.GetSlice("joint");
                stemTexture  = anim.GetSlice("stem");
            }

            AddAnimation(GetAnimation());
            SetMaxHp(20);

            Become <IdleState>();

            Flying        = true;
            Depth         = Layers.FlyingMob;
            AlwaysVisible = true;             // Hackz :x

            var body = new CircleBodyComponent(1, 2.5f, 5.5f, BodyType.Dynamic, true);

            AddComponent(body);

            body.KnockbackModifier  = 0.5f;
            body.Body.LinearDamping = 5;

            Width = 13;

            var a = GetComponent <MobAnimationComponent>();

            a.Centered   = true;
            a.OriginX    = 6.5f;
            a.OriginY    = 8;
            a.CustomFlip = true;
            a.AddOrigin  = false;

            RemoveComponent <ShadowComponent>();
        }