Exemple #1
0
        public static new CCBezierTo actionWithDuration(float t, ccBezierConfig c)
        {
            CCBezierTo cCBezierTo = new CCBezierTo();

            cCBezierTo.initWithDuration(t, c);
            return(cCBezierTo);
        }
Exemple #2
0
        public override CCObject copyWithZone(CCZone zone)
        {
            CCZone     cCZone     = zone;
            CCBezierTo cCBezierTo = null;

            if (cCZone == null || cCZone.m_pCopyObject == null)
            {
                cCBezierTo = new CCBezierTo();
                cCZone     = new CCZone(cCBezierTo);
            }
            else
            {
                cCBezierTo = cCZone.m_pCopyObject as CCBezierTo;
                if (cCBezierTo == null)
                {
                    return(null);
                }
            }
            base.copyWithZone(cCZone);
            cCBezierTo.initWithDuration(this.m_fDuration, this.m_sConfig);
            return(cCBezierTo);
        }
Exemple #3
0
        public override void OnEnter()
        {
            base.OnEnter();

            var s = CCDirector.SharedDirector.WinSize;

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

            centerSprites(3);

            // sprite 1
            ccBezierConfig bezier;
            bezier.ControlPoint1 = new CCPoint(0, s.Height / 2);
            bezier.ControlPoint2 = new CCPoint(300, -s.Height / 2);
            bezier.EndPosition = new CCPoint(300, 100);

            var bezierForward = new CCBezierBy (3, bezier);
            var bezierBack = bezierForward.Reverse();
            var rep = new CCRepeatForever ((CCActionInterval)CCSequence.FromActions(bezierForward, bezierBack));

            // sprite 2
            m_tamara.Position = new CCPoint(80, 160);
            ccBezierConfig bezier2;
            bezier2.ControlPoint1 = new CCPoint(100, s.Height / 2);
            bezier2.ControlPoint2 = new CCPoint(200, -s.Height / 2);
            bezier2.EndPosition = new CCPoint(240, 160);

            var bezierTo1 = new CCBezierTo (2, bezier2);

            // sprite 3
            m_kathia.Position = new CCPoint(400, 160);
            var bezierTo2 = new CCBezierTo (2, bezier2);

            m_grossini.RunAction(rep);
            m_tamara.RunAction(bezierTo1);
            m_kathia.RunAction(bezierTo2);
        }