Beispiel #1
0
        /// <summary>
        /// Adds the game over screen sprites.
        /// </summary>
        private void AddGameOver()
        {
            // TODO should be a sprite scene builder
            IDrawable      drawable = Game.Theme.DrawableFactory.Create("game-over");
            DrawableSprite ds       = new DrawableSprite(drawable);

            ds.X      = ds.Y = 0;
            ds.Width  = viewport.Width;
            ds.Height = viewport.Height;
            sprites.Add(ds);

            // Queue the redraw
            QueueDraw();

            // Do the high score processing
            HighScoreTable hst = Game.HighScores.GetTable(Game.Config);

            if (hst.IsHighScore(Game.Score))
            {
                // We need to get the username
                UserNameDialog dialog = new UserNameDialog();
                dialog.Run();
                dialog.Destroy();

                // Register it
                hst.RegisterScores(Game.Config.UserName, Game.Score);
            }

            // Show the high score
            HighScoreWindow hsw = new HighScoreWindow();

            hsw.ShowAll();
        }
Beispiel #2
0
        /// <summary>
        /// Adds the game over screen sprites.
        /// </summary>
        private void AddGameOver()
        {
            // TODO should be a sprite scene builder
            IDrawable drawable = Game.Theme.DrawableFactory.Create("game-over");
            DrawableSprite ds = new DrawableSprite(drawable);
            ds.X = ds.Y = 0;
            ds.Width = viewport.Width;
            ds.Height = viewport.Height;
            sprites.Add(ds);

            // Queue the redraw
            QueueDraw();

            // Do the high score processing
            HighScoreTable hst = Game.HighScores.GetTable(Game.Config);

            if (hst.IsHighScore(Game.Score))
            {
                // We need to get the username
                UserNameDialog dialog = new UserNameDialog();
                dialog.Run();
                dialog.Destroy();

                // Register it
                hst.RegisterScores(Game.Config.UserName, Game.Score);
            }

            // Show the high score
            HighScoreWindow hsw = new HighScoreWindow();
            hsw.ShowAll();
        }