public override void OnEnter() { base.OnEnter(); CCSize windowSize = Layer.VisibleBoundsWorldspace.Size; grossini.Position = new CCPoint(windowSize.Width / 3f, windowSize.Height / 2f); ball.Position = new CCPoint(windowSize.Width * 2f / 3f, windowSize.Height / 2f); hit.Visible = false; grossini.RunAction(new CCRepeatForever(new CCParallel( new CCRotateBy(9f, 360f), new CCSequence(new CCMoveBy(3f, new CCPoint(-100f, 0)), new CCMoveBy(3f, new CCPoint(500f, 0f)), new CCMoveBy(3f, new CCPoint(-400f, 0))) ))); ball.RunAction(new CCRepeatForever(new CCSequence(new CCMoveBy(1.5f, new CCPoint(-400f, 0)), new CCMoveBy(2f, new CCPoint(600f, 0f)), new CCMoveBy(1f, new CCPoint(-200f, 0))))); Schedule(new Action <float>(UpdateTest), .25f); }
public SpriteMaskTest() { grossini = new CCMaskedSprite("Images/grossini", GetCollisionMask("grossini")); ball = new CCMaskedSprite("Images/ball-hd", GetCollisionMask("ball-hd")); hit = new CCSprite("Images/Icon"); CCSize s = CCDirector.SharedDirector.WinSize; grossini.Position = new CCPoint(s.Width / 3f, s.Height / 2f); ball.Position = new CCPoint(s.Width * 2f / 3f, s.Height / 2f); AddChild(grossini, 1); AddChild(ball, 1); AddChild(hit, 5); hit.Visible = false; grossini.RunAction(new CCRepeatForever(new CCParallel( new CCRotateBy(9f, 360f), new CCSequence(new CCMoveBy(3f, new CCPoint(-100f, 0)), new CCMoveBy(3f, new CCPoint(500f, 0f)), new CCMoveBy(3f, new CCPoint(-400f, 0))) ))); ball.RunAction(new CCRepeatForever(new CCSequence(new CCMoveBy(1.5f, new CCPoint(-400f, 0)), new CCMoveBy(2f, new CCPoint(600f, 0f)), new CCMoveBy(1f, new CCPoint(-200f, 0))))); Schedule(new Action <float>(UpdateTest), .25f); }