public static CCScene GameScene(CCWindow mainWindow) { var scene = new CCScene(mainWindow); var layer = new GameLayer(); scene.AddChild(layer); return(scene); }
public GameStartLayer(float sx, float sy) : base() { this.sx = sx; this.sy = sy; var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => { var transitionToGame = new CCTransitionRotoZoom(0.7f, GameLayer.GameScene(Window)); Window.DefaultDirector.ReplaceScene(transitionToGame); }; AddEventListener(touchListener, this); }
public static CCScene GameScene(CCWindow mainWindow) { var scene = new CCScene(mainWindow); float w_baseline = 640.0f; float h_baseline = 1136.0f; CCSize winSize = mainWindow.WindowSizeInPixels; var layer = new GameLayer(winSize.Width / w_baseline, winSize.Height / h_baseline); scene.AddChild(layer); return(scene); }
public GameOverLayer(int score) { var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene(GameLayer.GameScene(Window)); AddEventListener(touchListener, this); scoreMessage = String.Format("Game Over. Your Score : {0} !", score); Color = new CCColor3B(CCColor4B.Black); Opacity = 255; // MobileService.UpdateScoreToServer (score); }
public GameStartLayer() : base() { var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene(GameLayer.GameScene(Window)); AddEventListener(touchListener, this); Color = CCColor3B.Black; Opacity = 255; }
public GameOverLayer(int score) { var touchListener = new CCEventListenerTouchAllAtOnce(); touchListener.OnTouchesEnded = (touches, ccevent) => Window.DefaultDirector.ReplaceScene(GameLayer.GameScene(Window)); AddEventListener(touchListener, this); scoreMessage = String.Format("Game Over. You collected {0} bananas!", score); Color = new CCColor3B(CCColor4B.Black); Opacity = 255; }