Beispiel #1
0
        public override void Start(Timeline t, Vector2 origin, Vector2 impulse)
        {
            base.Start(t, origin, impulse);
            var close = Far + _distanceInterpolation.From(Rand.Between(0, 1f));

            Width = close * W * Rand.Between(.8f, 1f);
            Height = H * close * Rand.Between(.8f, 1.5f);
            Alpha = (A * close).Clamp(.01f, 1f);
            Y += Rand.Float() * Spread * Rand.Sign();

            var speed = Speed * close * close;

            t.Tween(v => Velocity = new Vector2(v, 0), 0, -speed, 2, Sine.EaseIn);
            t.Tween(v => Width = v, 1f, close * W * Rand.Between(.8f, 1f), 1, Sine.EaseIn);
            t.Tween(v => Y = v, Y, Y + close * Rand.Between(-SpreadRange, SpreadRange), 10f / close, Sine.EaseIn);
        }
Beispiel #2
0
        public override void Start(Timeline t, Vector2 origin, Vector2 impulse)
        {
            base.Start(t, origin, impulse);

            Height = 1;
            HorizontalAlignment = HorizontalAlignment.Left;
            VerticalAlignment = VerticalAlignment.Top;

            var screen = Render.Camera.ScreenArea;
            Position = new Vector2(Rand.Between(screen.Left, screen.Right),
                                   Rand.Between(screen.Top, screen.Bottom));

            var alpha = Rand.Between(.2f, .9f);
            t.Tween(v => Alpha = v, 0, alpha, 5, Sine.EaseInOut);

            _length = Rand.Between(.1f, .3f);
        }