コード例 #1
0
        public static CCScene GameScene(CCWindow mainWindow)
        {
            var scene = new CCScene(mainWindow);
            var layer = new GameLayer();

            scene.AddChild(layer);

            return(scene);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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;
        }