//what occurs when gameOver == true void GameOver(bool isGameOver) { if (isGameOver) { CCLabel label = new CCLabel("Tap to return to Level Select", "Arial", 50, CCLabelFormat.SystemFont); label.PositionX = 400; label.PositionY = 1000; label.AnchorPoint = CCPoint.AnchorUpperLeft; AddChild(label); var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene(LevelSelect.GetLevelSelectScene(Window)); AddEventListener(touchListener, this); highScore = p1Score; } }
//LevelComplete displays the highscore and provides means to return to Level Select once the level is complete void LevelComplete(CCRect boundary) { highScore = p1Score; CCLabel label = new CCLabel("Level Complete!", "Arial", 60, CCLabelFormat.SystemFont); label.Position = boundary.Center; label.AnchorPoint = CCPoint.AnchorMiddle; label.Text = string.Format("Level Complete! Highscore: {0}", highScore); AddChild(label); CCLabel tapToReturn = new CCLabel("Tap to return to Level Select", "Arial", 50, CCLabelFormat.SystemFont); tapToReturn.PositionX = boundary.MaxX / 2; tapToReturn.PositionY = 1000; AddChild(tapToReturn); var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene(LevelSelect.GetLevelSelectScene(Window)); AddEventListener(touchListener, this); }
public TitleLayer() : base() { var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene(LevelSelect.GetLevelSelectScene(Window)); AddEventListener(touchListener, this); }