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); }
public override void OnEnter() { base.OnEnter(); MoveBy a1 = new MoveBy(1, new PointF(150, 0)); Repeat action1 = new Repeat(new Sequence(new Place(new PointF(60, 60)), a1), 3); RepeatForever action2 = new RepeatForever(new Sequence(a1.Clone() as FiniteTimeAction, a1.Reverse() as FiniteTimeAction)); _grossini.RunAction(action1); _tamara.RunAction(action2); }