Beispiel #1
0
        public ConnectedMoveBlock(Vector2 position, int width, int height, MoveBlock.Directions direction, float moveSpeed)
            : base(position, width, height, safe: false)
        {
            Depth          = Depths.Player - 1;
            startPosition  = position;
            Direction      = direction;
            this.moveSpeed = moveSpeed;

            homeAngle   = targetAngle = angle = direction.Angle();
            Add(moveSfx = new SoundSource());
            Add(new Coroutine(Controller()));
            UpdateColors();
            Add(new LightOcclude(0.5f));
        }
        public DreamMoveBlock(EntityData data, Vector2 offset)
            : base(data, offset)
        {
            startPosition = Position;

            // Backwards Compatibility
            moveSpeed = data.Bool("fast") ? FastMoveSpeed : data.Float("moveSpeed", MoveSpeed);
            noCollide = data.Bool("noCollide");

            Direction = data.Enum <MoveBlock.Directions>("direction");
            homeAngle = targetAngle = angle = Direction.Angle();

            arrows         = GFX.Game.GetAtlasSubtextures("objects/CommunalHelper/dreamMoveBlock/arrow");
            Add(moveSfx    = new SoundSource());
            Add(controller = new Coroutine(Controller()));
            Add(new LightOcclude(0.5f));

            Add(new MoveBlockRedirectable(new MonoMod.Utils.DynamicData(this))
            {
                Get_CanSteer  = () => false,
                Get_Direction = () => Direction,
                Set_Direction = dir => Direction = dir
            });
        }