//--------------------------------------------------------------------------------------------------------- // RetryLevel //--------------------------------------------------------------------------------------------------------- // If the player didn't pass the level, let them play it over //--------------------------------------------------------------------------------------------------------- void RetryLevel(object stuff = null) { var level = ChallengeLevelLayer.CreateScene(Window, lastLevelPlayed, activePlayer); var transitionToGame = new CCTransitionFade(2.0f, level); Director.ReplaceScene(transitionToGame); }
//--------------------------------------------------------------------------------------------------------- // QuitLevel //--------------------------------------------------------------------------------------------------------- // If they've had enough for now, let them quit back to the Select Challenge layer //--------------------------------------------------------------------------------------------------------- void QuitLevel(object stuff = null) { var mainMenu = SelectChallengeLayer.CreateScene(Window, activePlayer); var transitionToMainMenu = new CCTransitionFade(2.0f, mainMenu); Director.ReplaceScene(transitionToMainMenu); }
void StartNewGame(object stuff = null) { var level = LevelIntroLayer.CreateScene(Window, levels, activePlayer); var transitionToGame = new CCTransitionFade(3.0f, level); Director.ReplaceScene(transitionToGame); }
void CancelNewGame(object stuff = null) { var mainMenu = GameStartLayer.CreateScene(Window); var transitionToMainMenu = new CCTransitionFade(3.0f, mainMenu); Director.ReplaceScene(transitionToMainMenu); }
public HighScoreLayer(int score) : base() { currentScore = score; var batchnode = GetChildByTag((int)Tags.SpriteManager) as CCSpriteBatchNode; var title = CCSprite.Create(batchnode.Texture, new CCRect(608, 192, 225, 57)); title.Position = new CCPoint(160, 240); batchnode.AddChild(title); var button1 = new CCMenuItemImage("Images/playAgainButton", "Images/playAgainButton", new SEL_MenuHandler((sender) => { CCDirector.SharedDirector.ReplaceScene(CCTransitionFade.Create(.5f, GameLayer.Scene, new CCColor3B(255, 255, 255))); })); var button2 = new CCMenuItemImage("Images/changePlayerButton", "Images/changePlayerButton", new SEL_MenuHandler((sender) => { // do nothing })); var menu = new CCMenu(button1, button2); menu.Position = new CCPoint(160, 58); menu.AlignItemsVerticallyWithPadding(9); AddChild(menu); }
void NextLevel(object stuff = null) { var nextLevel = LevelLayer.CreateScene(Window, levels, activePlayer); var transitionToGame = new CCTransitionFade(2.0f, nextLevel); Director.ReplaceScene(transitionToGame); }
//--------------------------------------------------------------------------------------------------------- // ContinueGame - Used in menu selection //--------------------------------------------------------------------------------------------------------- // Transitions to GameLayer //--------------------------------------------------------------------------------------------------------- void ContinueGame(object stuff = null) { var mainGame = LevelLayer.CreateScene(Window, levels, currentPlayer); var transitionToGame = new CCTransitionFade(2.0f, mainGame); Director.ReplaceScene(transitionToGame); }
void StartLevel() { var levelScene = LevelLayer.CreateScene(Window, levels, activePlayer); var transitionToLevel = new CCTransitionFade(3.0f, levelScene); Director.ReplaceScene(transitionToLevel); }
//--------------------------------------------------------------------------------------------------------- // NextLevel //--------------------------------------------------------------------------------------------------------- // Transitions to the next level if the player passed this level //--------------------------------------------------------------------------------------------------------- void NextLevel(object stuff = null) { var nextLevelToPlay = GetNextLevelToPlay(); var nextLevel = ChallengeLevelLayer.CreateScene(Window, nextLevelToPlay, activePlayer); var transitionToGame = new CCTransitionFade(2.0f, nextLevel); Director.ReplaceScene(transitionToGame); }
public void switchLayer(float dt) { //unschedule(schedule_selector(Bug624Layer::switchLayer)); CCScene scene = CCScene.node(); scene.addChild(Bug624Layer.node(), 0); CCDirector.sharedDirector().replaceScene(CCTransitionFade.transitionWithDuration(2.0f, scene, new ccColor3B { r = 255, g = 0, b = 0 })); }
//--------------------------------------------------------------------------------------------------------- // QuitLevel //--------------------------------------------------------------------------------------------------------- // Transitions to the main MenuLayer //--------------------------------------------------------------------------------------------------------- void QuitLevel(object stuff = null) { var nextTutorialLevel = GetNextTutorialLevelToPlay(); if (nextTutorialLevel.BranchNum > 0) { activePlayer.BranchProgression [1].IsLocked = false; activePlayer.BranchProgression [0].BranchState = CompletionState.completed; activePlayer.ConsumableAdd = activePlayer.ConsumableCheckPoint = activePlayer.ConsumableNextSeq = activePlayer.ConsumableSubtract = 0; activePlayer.WriteData(activePlayer); } var mainMenu = MenuLayer.CreateScene(Window); var transitionToMainMenu = new CCTransitionFade(2.0f, mainMenu); Director.ReplaceScene(transitionToMainMenu); }
void ShowHighScores() { gameSuspended = true; CCDirector.SharedDirector.ReplaceScene(CCTransitionFade.Create(1, HighScoreLayer.Scene(score), new CCColor3B(255, 255, 255))); }
private void click_start(CCObject sender) { var s = CCTransitionFade.transitionWithDuration(0.5f, GameRoot.pSceneSelect); CCDirector.sharedDirector().pushScene(s); }
public static CCTransitionScene createTransition(int nIndex, float t, CCScene s) { // fix bug #486, without setDepthTest(false), FlipX,Y will flickers CCDirector.sharedDirector().setDepthTest(false); switch (nIndex) { case 0: return(CCTransitionJumpZoom.transitionWithDuration(t, s)); case 1: return(CCTransitionFade.transitionWithDuration(t, s)); case 2: return(FadeWhiteTransition.transitionWithDuration(t, s)); case 3: return(FlipXLeftOver.transitionWithDuration(t, s)); case 4: return(FlipXRightOver.transitionWithDuration(t, s)); case 5: return(FlipYUpOver.transitionWithDuration(t, s)); case 6: return(FlipYDownOver.transitionWithDuration(t, s)); case 7: return(FlipAngularLeftOver.transitionWithDuration(t, s)); case 8: return(FlipAngularRightOver.transitionWithDuration(t, s)); case 9: return(ZoomFlipXLeftOver.transitionWithDuration(t, s)); case 10: return(ZoomFlipXRightOver.transitionWithDuration(t, s)); case 11: return(ZoomFlipYUpOver.transitionWithDuration(t, s)); case 12: return(ZoomFlipYDownOver.transitionWithDuration(t, s)); case 13: return(ZoomFlipAngularLeftOver.transitionWithDuration(t, s)); case 14: return(ZoomFlipAngularRightOver.transitionWithDuration(t, s)); case 15: return(CCTransitionShrinkGrow.transitionWithDuration(t, s)); case 16: return(CCTransitionRotoZoom.transitionWithDuration(t, s)); //case 17: return CCTransitionMoveInL.transitionWithDuration(t, s); //case 18: return CCTransitionMoveInR.transitionWithDuration(t, s); //case 19: return CCTransitionMoveInT.transitionWithDuration(t, s); //case 20: return CCTransitionMoveInB.transitionWithDuration(t, s); case 17: return(CCTransitionSlideInL.transitionWithDuration(t, s)); case 18: return(CCTransitionSlideInR.transitionWithDuration(t, s)); case 19: return(CCTransitionSlideInT.transitionWithDuration(t, s)); case 20: return(CCTransitionSlideInB.transitionWithDuration(t, s)); case 21: { if (CCConfiguration.sharedConfiguration().getGlesVersion() <= CCGlesVersion.GLES_VER_1_0) { //CCMessageBox("The Opengl ES version is lower than 1.1, and TransitionCrossFade may not run correctly, it is ignored.", "Cocos2d-x Hint"); return(null); } else { return(CCTransitionCrossFade.transitionWithDuration(t, s)); } } case 22: { if (CCConfiguration.sharedConfiguration().getGlesVersion() <= CCGlesVersion.GLES_VER_1_0) { //CCMessageBox("The Opengl ES version is lower than 1.1, and TransitionRadialCCW may not run correctly, it is ignored.", "Cocos2d-x Hint"); return(null); } else { return(CCTransitionRadialCCW.transitionWithDuration(t, s)); } } case 23: { if (CCConfiguration.sharedConfiguration().getGlesVersion() <= CCGlesVersion.GLES_VER_1_0) { //CCMessageBox("The Opengl ES version is lower than 1.1, and TransitionRadialCW may not run correctly, it is ignored.", "Cocos2d-x Hint"); return(null); } else { return(CCTransitionRadialCW.transitionWithDuration(t, s)); } } case 24: return(PageTransitionForward.transitionWithDuration(t, s)); // case 25: return PageTransitionBackward.transitionWithDuration(t, s); case 26: return(CCTransitionFadeTR.transitionWithDuration(t, s)); case 27: return(CCTransitionFadeBL.transitionWithDuration(t, s)); case 28: return(CCTransitionFadeUp.transitionWithDuration(t, s)); case 29: return(CCTransitionFadeDown.transitionWithDuration(t, s)); case 30: return(CCTransitionTurnOffTiles.transitionWithDuration(t, s)); case 31: return(CCTransitionSplitRows.transitionWithDuration(t, s)); case 25: return(CCTransitionSplitCols.transitionWithDuration(t, s)); default: break; } return(null); }
public void click_star(CCObject sender) { var s = CCTransitionFade.transitionWithDuration(0.5f, GameRoot.pGameScene); CCDirector.sharedDirector().pushScene(s); }
public void click_back(CCObject s) { var a = CCTransitionFade.transitionWithDuration(0.5f, GameRoot.pSelectScene); CCDirector.sharedDirector().pushScene(a); }
public static CCTransitionScene transitionWithDuration(float t, CCScene s) { return(CCTransitionFade.transitionWithDuration(t, s, ccWHITE)); }
//--------------------------------------------------------------------------------------------------------- // NewGame - Used in menu selection //--------------------------------------------------------------------------------------------------------- // Transitions to LevelLayer //--------------------------------------------------------------------------------------------------------- void NewGame(object stuff = null) { if (currentPlayer.BranchProgression[1].LastLevelCompleted > -1) { //if (currentPlayer.LastLevelCompleted > -1) { CCRect bounds = VisibleBoundsWorldspace; PauseListeners(true); Application.Paused = true; var newGameLayer = new CCLayerColor(new CCColor4B(0, 0, 0, 230)); AddChild(newGameLayer, 99999); // Add frame to layer frameSprite = new CCSprite(uiSpriteSheet.Frames.Find(x => x.TextureFilename.Equals("frame.png"))); frameSprite.AnchorPoint = CCPoint.AnchorMiddle; frameSprite.Position = new CCPoint(bounds.Size.Width / 2, bounds.Size.Height / 2); newGameLayer.AddChild(frameSprite); newGameWarning = new CCLabel("This will erase your current progress!\n\n\nProceed?", GOTHIC_56_WHITE_FNT); newGameWarning.AnchorPoint = CCPoint.AnchorMiddle; newGameWarning.Scale = 1.5f; newGameWarning.Position = new CCPoint(frameSprite.BoundingBox.Center); newGameWarning.HorizontalAlignment = CCTextAlignment.Center; newGameLayer.AddChild(newGameWarning); okLabel = new CCLabel("OK", GOTHIC_44_HD_FNT); okLabel.AnchorPoint = CCPoint.AnchorMiddle; okLabel.Scale = 1.5f; cancelLabel = new CCLabel("Cancel", GOTHIC_44_HD_FNT); cancelLabel.AnchorPoint = CCPoint.AnchorMiddle; cancelLabel.Scale = 1.5f; var okItem = new CCMenuItemLabel(okLabel, okSender => { newGameLayer.RemoveFromParent(); ResumeListeners(true); Application.Paused = false; currentPlayer = new Player(); currentPlayer.WriteData(currentPlayer); var mainGame = LevelLayer.CreateScene(Window, levels, currentPlayer); var transitionToGame = new CCTransitionFade(2.0f, mainGame); Director.ReplaceScene(transitionToGame); }); okItem.Position = bounds.Center; var cancelItem = new CCMenuItemLabel(cancelLabel, cancelSender => { newGameLayer.RemoveFromParent(); ResumeListeners(true); Application.Paused = false; }); cancelItem.Position = bounds.Center; var closeMenu = new CCMenu(okItem, cancelItem); closeMenu.AlignItemsHorizontally(50); closeMenu.AnchorPoint = CCPoint.AnchorMiddleBottom; closeMenu.Position = new CCPoint(bounds.Size.Width / 2, frameSprite.BoundingBox.MinY + (okLabel.BoundingBox.Size.Height * 2.5f)); newGameLayer.AddChild(closeMenu); } else { var mainGame = LevelLayer.CreateScene(Window, levels, currentPlayer); var transitionToGame = new CCTransitionFade(2.0f, mainGame); Director.ReplaceScene(transitionToGame); } }
private void click_people(CCObject sender) { var s = CCTransitionFade.transitionWithDuration(0.5f, GameRoot.pSelect_employee); CCDirector.sharedDirector().pushScene(s); }