public GameScoresLayer() { var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesBegan = (touches, ccevent) => { var mainGame = GameStartLayer.CreateScene(Window); var transitionToGameOver = new CCTransitionMoveInL(0.3f, mainGame); Director.ReplaceScene(transitionToGameOver); }; AddEventListener(touchListener, this); scoreMessage = String.Format("Current High Score"); Color = new CCColor3B(127, 200, 205); Opacity = 255; var moveUp = new CCMoveBy(1.0f, new CCPoint(0.0f, 50.0f)); var moveDown = moveUp.Reverse(); // A CCSequence action runs the list of actions in ... sequence! CCSequence moveSeq = new CCSequence(new CCEaseBackInOut(moveUp), new CCEaseBackInOut(moveDown)); repeatedAction = new CCRepeatForever(moveSeq); }
public GameTutorialLayer(bool startGameAfter) : base() { titleMessage = "How to play: Part {0} of " + tutorials.Length; var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => { currentTutorial++; if (currentTutorial >= tutorials.Length) { if (startGameAfter) { var mainGame = GameMainLayer.CreateScene(Window); var transitionToGameOver = new CCTransitionMoveInR(0.3f, mainGame); Director.ReplaceScene(transitionToGameOver); } else { var mainGame = GameStartLayer.CreateScene(Window); var transitionToGameOver = new CCTransitionMoveInL(0.3f, mainGame); Director.ReplaceScene(transitionToGameOver); } } else { SetCurrentMessages(); } }; AddEventListener(touchListener, this); Color = new CCColor3B(127, 200, 205); Opacity = 255; }
public static new CCTransitionMoveInL Create(float t, CCScene scene) { var pScene = new CCTransitionMoveInL(); pScene.InitWithDuration(t, scene); return pScene; }