Exemplo n.º 1
0
        public BezierConfig Negate()
        {
            BezierConfig ret = new BezierConfig();

            ret.StartPosition = StartPosition.Negate();
            ret.EndPosition = EndPosition.Negate();
            ret.ControlPoint1 = ControlPoint1.Negate();
            ret.ControlPoint2 = ControlPoint2.Negate();

            return ret;
        }
Exemplo n.º 2
0
        public override void OnEnter()
        {
            base.OnEnter();

            SizeF s = Director.Instance.WinSize;

            //
            // startPosition can be any coordinate, but since the movement
            // is relative to the Bezier curve, make it (0,0)
            //

            // sprite 1
            BezierConfig bezier = new BezierConfig();
            bezier.StartPosition = PointF.Empty;
            bezier.ControlPoint1 = new PointF(0, s.Height / 2);
            bezier.ControlPoint2 = new PointF(300, -s.Height / 2);
            bezier.EndPosition = new PointF(300, 100);

            BezierBy bezierForward = new BezierBy(3, bezier);
            BezierBy bezierBack = bezierForward.Reverse() as BezierBy;
            Sequence seq = new Sequence(bezierForward, bezierBack);
            RepeatForever rep = new RepeatForever(seq);

            // sprite 2
            BezierConfig bezier2 = new BezierConfig();
            bezier2.StartPosition = PointF.Empty;
            bezier2.ControlPoint1 = new PointF(100, s.Height / 2);
            bezier2.ControlPoint2 = new PointF(200, -s.Height / 2);
            bezier2.EndPosition = new PointF(300, 0);

            BezierBy bezierForward2 = new BezierBy(3, bezier2);
            BezierBy bezierBack2 = bezierForward2.Reverse() as BezierBy;
            Sequence seq2 = new Sequence(bezierForward2, bezierBack2);
            RepeatForever rep2 = new RepeatForever(seq2);

            _grossini.RunAction(rep);
            _tamara.RunAction(rep2);
        }
Exemplo n.º 3
0
 public BezierBy(float duration, BezierConfig config)
     : base(duration)
 {
     _config = config;
 }