Example #1
0
        public override CCFiniteTimeAction Reverse ()
        {
            CCBezierConfig r;

            r.EndPosition = -BezierConfig.EndPosition;
            r.ControlPoint1 = BezierConfig.ControlPoint2 + -BezierConfig.EndPosition;
            r.ControlPoint2 = BezierConfig.ControlPoint1 + -BezierConfig.EndPosition;

            var action = new CCBezierBy (Duration, r);
            return action;
        }
Example #2
0
        public override CCFiniteTimeAction Reverse()
        {
            CCBezierConfig r;

            r.EndPosition   = -BezierConfig.EndPosition;
            r.ControlPoint1 = BezierConfig.ControlPoint2 + -BezierConfig.EndPosition;
            r.ControlPoint2 = BezierConfig.ControlPoint1 + -BezierConfig.EndPosition;

            var action = new CCBezierBy(Duration, r);

            return(action);
        }
Example #3
0
 public CCBezierByState(CCBezierBy action, CCNode target)
     : base(action, target)
 {
     BezierConfig     = action.BezierConfig;
     PreviousPosition = StartPosition = target.Position;
 }
Example #4
0
        public override void OnEnter()
        {
            base.OnEnter(); 

            CCSize windowSize = Layer.VisibleBoundsWorldspace.Size;

            CenterSprites(3);

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

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


            // sprite 2
            Tamara.Position = new CCPoint(80, 160);
            CCBezierConfig bezier2;
            bezier2.ControlPoint1 = new CCPoint(100, windowSize.Height / 2);
            bezier2.ControlPoint2 = new CCPoint(200, -windowSize.Height / 2);
            bezier2.EndPosition = new CCPoint(240, 160);

            var bezierTo1 = new CCBezierTo (2, bezier2);

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

            Grossini.RunAction(rep);
            Tamara.RunAction(bezierTo1);
            Kathia.RunAction(bezierTo2);
        }
Example #5
0
        public override void RunActionsInSprite(CCSprite sprite)
        {
            CCSize s = Layer.VisibleBoundsWorldspace.Size;

            // 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);

            CCBezierBy bezierForward = new CCBezierBy(3, bezier);
            CCBezierBy bezierBack = (CCBezierBy) bezierForward.Reverse();
            CCSequence seq = new CCSequence(bezierForward, bezierBack);
            CCRepeatForever rep = new CCRepeatForever(seq);
            sprite.RunAction(rep);

            sprite.RunAction(
                new CCRepeatForever(
                    new CCSequence(
                        new CCMoveBy(0.05f, new CCPoint(10, 0)),
                        new CCMoveBy(0.05f, new CCPoint(-10, 0))
                    )
                )
            );
        }
Example #6
0
 public CCBezierByState (CCBezierBy action, CCNode target)
     : base (action, target)
 { 
     BezierConfig = action.BezierConfig;
     PreviousPosition = StartPosition = target.Position;
 }