コード例 #1
0
        public GenericStrawberrySeed(IStrawberrySeeded strawberry, Vector2 position, int index, bool ghost) : base(position)
        {
            this.Strawberry                = strawberry;
            base.Depth                     = -100;
            this.start                     = this.Position;
            base.Collider                  = new Hitbox(12f, 12f, -6f, -6f);
            this.index                     = index;
            this.ghost                     = ghost;
            base.Add(this.follower         = new Follower(new Action(this.OnGainLeader), new Action(this.OnLoseLeader)));
            this.follower.FollowDelay      = 0.2f;
            this.follower.PersistentFollow = false;
            base.Add(new StaticMover {
                SolidChecker = ((Solid s) => s.CollideCheck(this)),
                OnAttach     = delegate(Platform p) {
                    base.Depth    = -1000000;
                    base.Collider = new Hitbox(24f, 24f, -12f, -12f);
                    this.attached = p;
                    this.start    = this.Position - p.Position;
                }
            });
            base.Add(new PlayerCollider(new Action <Player>(this.OnPlayer), null, null));
            base.Add(this.wiggler = Wiggler.Create(0.5f, 4f, delegate(float v) {
                this.sprite.Scale = Vector2.One * (1f + 0.2f * v);
            }, false, false));
            base.Add(this.sine       = new SineWave(0.5f, 0f).Randomize());
            base.Add(this.shaker     = new Shaker(false, null));
            base.Add(this.bloom      = new BloomPoint(1f, 12f));
            base.Add(this.light      = new VertexLight(Color.White, 1f, 16, 24));
            base.Add(this.lightTween = this.light.CreatePulseTween());

            if (P_Burst == null)
            {
                P_Burst = StrawberrySeed.P_Burst;
            }
        }
コード例 #2
0
        public GenericStrawberrySeed(IStrawberrySeeded strawberry, Vector2 position, int index, bool ghost)
            : base(position)
        {
            Strawberry = strawberry;
            Depth      = Depths.Pickups;
            start      = Position;
            Collider   = new Hitbox(12f, 12f, -6f, -6f);
            this.index = index;
            this.ghost = ghost;

            Add(follower              = new Follower(OnGainLeader, OnLoseLeader));
            follower.FollowDelay      = 0.2f;
            follower.PersistentFollow = false;

            Add(new StaticMover {
                SolidChecker = solid => solid.CollideCheck(this),
                OnAttach     = platform => {
                    Depth    = Depths.Top;
                    Collider = new Hitbox(24f, 24f, -12f, -12f);
                    attached = platform;
                    start    = Position - platform.Position;
                }
            });
            Add(new PlayerCollider(OnPlayer));

            Add(wiggler = Wiggler.Create(0.5f, 4f, v => {
                sprite.Scale = Vector2.One * (1f + 0.2f * v);
            }, false, false));
            Add(sine       = new SineWave(0.5f, 0f).Randomize());
            Add(shaker     = new Shaker(false, null));
            Add(bloom      = new BloomPoint(1f, 12f));
            Add(light      = new VertexLight(Color.White, 1f, 16, 24));
            Add(lightTween = light.CreatePulseTween());

            if (P_Burst == null)
            {
                P_Burst = StrawberrySeed.P_Burst;
            }
        }
コード例 #3
0
 public CSGEN_GenericStrawberrySeeds(IStrawberrySeeded strawberry) : base(true, false)
 {
     this.strawberry = strawberry;
 }