예제 #1
0
        void GameOver()
        {
            SKTransition reveal        = SKTransition.FlipHorizontalWithDuration(0.5);
            var          gameOverScene = new GameOverScene(Size, (int)score);

            View.PresentScene(gameOverScene, reveal);
        }
예제 #2
0
        public GameOverScene(SizeF size, int score) : base(size)
        {
            BackgroundColor = new UIColor(0.15f, 0.15f, 0.3f, 1.0f);

            SKLabelNode label = SKLabelNode.FromFont("Chalkduster");

            label.Text      = "Your final score is: " + score + " Points";
            label.FontSize  = 30f;
            label.FontColor = UIColor.Black;
            label.Position  = new PointF(Size.Width / 2, Size.Height / 2);
            AddChild(label);

            RunAction(SKAction.Sequence(new [] {
                SKAction.WaitForDuration(3),
                SKAction.RunBlock(() => {
                    SKTransition reveal = SKTransition.FlipHorizontalWithDuration(0.5);
                    var scene           = new MyScene(size);

                    View.PresentScene(scene, reveal);
                }),
            }));
        }