public void Draw(SpriteBatch spriteBatch)
        {
            String text = " ";

            if (exitCase == 1)
            {
                text = "Out of energy.";
            }

            if (exitCase == 2)
            {
                text = "Gibbon out of bounds.";
            }

            if (exitCase == 3)
            {
                text = "Out of time.";
            }

            spriteBatch.Begin();

            spriteBatch.Draw(game.staticBG, Vector2.Zero, Color.White);
            game.DrawText(new Vector2(game.screenCenter.X, 100f), "Game over!", game.quartz_big, true, Color.Black);
            game.DrawText(game.screenCenter, text, game.quartz_big, true, Color.Black);
            game.DrawText(new Vector2(game.screenCenter.X, 800f), "Your distance: " + game.getScore().ToString() + " m", game.quartz_big, true, Color.Black);


            spriteBatch.End();
        }
Example #2
0
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();


            game.DrawText(new Vector2(drawCenter, 300), title, game.quartz_big, true, Color.Black);

            for (int i = 0; i < num_to_follow; i++)
            {
                game.DrawText(new Vector2(drawCenter - 100, 400 + 50 * i), ((i + 1) + ". " + leaders[i].ToString()), game.quartz_small, Color.Black);
            }

            spriteBatch.End();
        }
        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();

            spriteBatch.Draw(game.staticBG, Vector2.Zero, Color.White);
            game.DrawText(new Vector2(game.screenCenter.X - 100, 300), "_", game.quartz_big, true);
            game.DrawText(new Vector2(game.screenCenter.X, 300), "_", game.quartz_big, true);
            game.DrawText(new Vector2(game.screenCenter.X + 100, 300), "_", game.quartz_big, true);


            game.DrawText(new Vector2(game.screenCenter.X - 100, 300), ((char)currentIndices[0]).ToString(), game.quartz_big, true);
            game.DrawText(new Vector2(game.screenCenter.X, 300), ((char)currentIndices[1]).ToString(), game.quartz_big, true);
            game.DrawText(new Vector2(game.screenCenter.X + 100, 300), ((char)currentIndices[2]).ToString(), game.quartz_big, true);

            game.DrawText(new Vector2(game.screenCenter.X, 100), "New high score!", game.quartz_big, true);
            game.DrawText(new Vector2(game.screenCenter.X, 200), "Please enter your initials, using the DPAD or arrow keys. Press Start or Return when done.", game.quartz_small, true);

            Vector2 bananaPos    = new Vector2(game.screenCenter.X - 100 + 100 * currentLetter, 430);
            Vector2 bananaOrigin = new Vector2(game.bananaSprite.Width / 2f, game.bananaSprite.Height / 2f);

            spriteBatch.Draw(game.bananaSprite, bananaPos, null, Color.White, 0, bananaOrigin, 0.1f, SpriteEffects.None, 0f);


            spriteBatch.End();
        }
Example #4
0
        public void Draw(SpriteBatch spriteBatch)
        {
            float perct_health = currentHealth / maxHealth;

            Vector2 healthBarPosition = new Vector2(30f, 30f);

            game.DrawText(healthBarPosition + new Vector2(0f, -25f), "Energy", game.quartz_small);

            //Draw the box around the health bar
            spriteBatch.Draw(healthBarBorder, healthBarPosition, null, Color.Gray);

            //Draw the current health level based on the current Health
            spriteBatch.Draw(healthBarFill, new Rectangle((int)healthBarPosition.X + 1, (int)healthBarPosition.Y, (int)(healthBarFill.Width * perct_health), 43), null, Color.Red);
        }