public DreamBlockDebris Init(Vector2 pos, DreamBlockDummy block = null)
        {
            orig_Init(pos, '1');

            Block = block ?? new DreamBlockDummy(this);
            Image image = baseData.Get <Image>("image");

            Remove(image);
            Sprite sprite = new Sprite(GFX.Game, "objects/CommunalHelper/dreamMoveBlock/");
            float  speed  = Calc.Random.NextFloat(0.3f) + 0.1f;

            sprite.AddLoop("active", "debris", speed);
            sprite.AddLoop("disabled", "disabledDebris", speed);
            sprite.CenterOrigin();
            sprite.Color    = image.Color;
            sprite.Rotation = image.Rotation;
            sprite.Scale    = image.Scale;
            sprite.FlipX    = image.FlipX;
            sprite.FlipY    = image.FlipY;

            Add(sprite);
            sprite.Play(Block.PlayerHasDreamDash ? "active" : "disabled", randomizeFrame: true);
            baseData["image"] = this.sprite = sprite;

            if (Calc.Random.Next(4) == 0)
            {
                activePointColor   = Calc.Random.Choose(activeParticleColors);
                disabledPointColor = Color.LightGray * (0.5f + Calc.Random.Choose(0, 1, 1, 2, 2, 2) / 2f * 0.5f);
                pointOffset        = new Vector2(Calc.Random.Next(-2, 2), Calc.Random.Next(-2, 2));
            }

            return(this);
        }
Ejemplo n.º 2
0
 public DreamDashCollider(Collider collider, Action <Player> onExit_player = null)
     : base(active: true, visible: false)
 {
     Collider = collider;
     Dummy    = new DreamBlockDummy(Entity);
     OnExit   = onExit_player;
 }