Exemplo n.º 1
0
        /// <summary>
        /// Render game screen. Called each frame.
        /// </summary>
        public void Run(DungeonQuestGame game)
        {
            // Let everything be handled by the game manager!
            game.gameManager.Run(true);

            if (Input.KeyboardEscapeJustPressed ||
                Input.GamePadBackJustPressed)
                // Just exit this screen and show end screen!
                quit = true;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Run game screen. Called each frame.
        /// </summary>
        /// <param name="game">Form for access to asteroid manager and co</param>
        public void Run(DungeonQuestGame game)
        {
            // Render background
            game.RenderMenuBackground();

            // Fill complete background to black (75%)
            bookTexture.RenderOnScreen(
                BaseGame.ResolutionRect,
                new Rectangle(128, 380, 1, 1),
                ColorHelper.ApplyAlphaToColor(Color.Black, 0.75f));

            //TODO: at the beginning?
            //Better at end when quitting, also show link to website and book and stuff ..

            // Credits
            TextureFont.WriteTextCentered(BaseGame.Width/2, RY(20), "Credits");

            int xPos = RX(60);
            int yPos = RY(111);
            WriteCredits(xPos, yPos- RY(40),
                "Dungeon Quest was created in 4 days on the GDC 2007.",
                "");
            WriteCredits(xPos, yPos, "Idea, Design, Programming",
                "Benjamin Nitschke (abi)");
            WriteCredits(xPos, yPos + RY(40), "3D Modeling, Design",
                "Christoph Rienaecker (WAII)");
            WriteCredits(xPos, yPos + RY(80),
                "Thanks to Kai Walter for the sound effects and music!", "");

            TextureFont.WriteText(xPos, yPos + RY(140),
                "Want to learn XNA?", Color.Gray);
            TextureFont.WriteText(xPos, yPos + RY(170),
                "Get my book:", Color.Gray);
            bookTexture.RenderOnScreen(new Rectangle(
                xPos, yPos + RY(200),
                RX((int)(BookGfxRect.Width*0.8f)),
                RY((int)(BookGfxRect.Height*0.8f))),
                BookGfxRect);

            xPos = RX(400);
            yPos += RY(130);
            WriteLink(xPos, yPos,
                "My blog: Many XNA Games and my book",
                "http://abi.exdream.com");
            WriteLink(xPos, yPos + RY(90),
                "XNA Creators Club Website",
                "http://creators.xna.com");
            WriteLink(xPos, yPos + RY(180),
                "XNA Team Blog",
                "http://blogs.msdn.com/xna");
            WriteLink(xPos, yPos + RY(270),
                "Official XNA Website on MSDN",
                "http://msdn.microsoft.com/xna");

            TextureFont.WriteTextCentered(BaseGame.Width/2, RY(600),
                "Dedicated to the great XNA Framework.");

            if (Input.KeyboardEscapeJustPressed ||
                Input.GamePadBackJustPressed ||
                Input.KeyboardSpaceJustPressed ||
                Input.GamePadAJustPressed ||
                Input.MouseLeftButtonJustPressed)
                // Just exit this screen and show end screen!
                quit = true;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Run game screen. Called each frame.
        /// </summary>
        /// <param name="game">Form for access to asteroid manager and co</param>
        public void Run(DungeonQuestGame game)
        {
            // Render background
            game.RenderMenuBackground();

            // Show highscores, allow to select between local highscores,
            // online highscores this hour and online highscores best of all time.
            int xPos = 100 * BaseGame.Width / 1024;
            int yPos = 260 * BaseGame.Height / 768;
            TextureFont.WriteText(xPos, yPos,
                "Highscores:");

            // Local Highscores
            Rectangle rect = new Rectangle(
                xPos + 210 * BaseGame.Width / 1024,
                yPos + 0 * BaseGame.Height / 768, 130, 28);
            bool highlighted = Input.MouseInBox(rect);
            TextureFont.WriteText(rect.X, rect.Y, "Local",
                highscoreMode == HighscoreModes.Local ? Color.Red :
                highlighted ? Color.LightSalmon : Color.White);
            if (highlighted &&
                Input.MouseLeftButtonJustPressed)
                highscoreMode = HighscoreModes.Local;

            yPos = 310 * BaseGame.Height / 768;
            Highscore[] selectedHighscores =
                highscoreMode == HighscoreModes.Local ?
                highscores : onlineHighscores;

            for (int num = 0; num < NumOfHighscores; num++)
            {
                Color col = Input.MouseInBox(new Rectangle(
                    xPos, yPos + num * 30, 600 + 200, 28)) ?
                    Color.White : ColorHelper.FromArgb(200, 200, 200);
                TextureFont.WriteText(xPos, yPos + num * 29,
                    (1 + num) + ".", col);
                TextureFont.WriteText(xPos + 50, yPos + num * 30,
                    selectedHighscores[num].name, col);
                TextureFont.WriteText(xPos + 340, yPos + num * 30,
                    "Score: " + selectedHighscores[num].points, col);
                TextureFont.WriteText(xPos + 610, yPos + num * 30,
                    "Mission: " + selectedHighscores[num].level, col);
            } // for (num)
            /*TODO
            if (game.RenderMenuButton(MenuButton.Back,
                new Point(1024 - 230, 768 - 150)))
            {
                quit = true;
            } // if
             */
        }