示例#1
0
        public GameOverScreen(Game1 game, SpriteBatch spriteBatch, AnimatedSprite Sp)
        {
            this.game = game;
            this.spriteBatch = spriteBatch;
            this.Sprite = Sp;

            spriteFont = game.Content.Load<SpriteFont>("menufont");
            image = game.Content.Load<Texture2D>("blood");
            string[] menuItems = { "Restart Game", "End Game" };
            menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
            game.Components.Add(menuComponent);
            imageRec = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height);

            // Start Bat placement into list
            rand = new Random();

            for (int i = 0; i < 60; i++)
            {
                Bat b = new Bat(game, spriteBatch, Sprite);
                b.Position = new Vector2(400 + (float)(-50 + rand.NextDouble() * 100),
                                         200 + (float)(-50 + rand.NextDouble() * 100));
                b.speed = 20f + (float)rand.NextDouble() * 40.0f;
                ListOBats.Add(b);
                game.Components.Add(b);
            }
            for (int j = 0; j < 60; j++)
            {
                ListOBats[j].batList = ListOBats;
            }
            // end bat placement into list
        }
示例#2
0
 public StartScreen(Game1 game, SpriteBatch spriteBatch)
 {
     this.game = game;
     this.spriteBatch = spriteBatch;
     spriteFont = game.Content.Load<SpriteFont>("menufont");
     image = game.Content.Load<Texture2D>("startmenubackground");
     string[] menuItems = { "Start Game", "Instructions", "End Game" };
     menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
     game.Components.Add(menuComponent);
     imageRec = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height);
 }
示例#3
0
 public PauseScreen(Game1 game, SpriteBatch spriteBatch)
 {
     this.game = game;
     this.spriteBatch = spriteBatch;
     menuTitle = "Paused";
     spriteFont = game.Content.Load<SpriteFont>("menufont");
     image = game.Content.Load<Texture2D>("MenuBG");
     string[] menuItems = { "Resume Game", "Quit Game" };
     menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
     game.Components.Add(menuComponent);
     imageRec = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height);
 }
示例#4
0
 public Instructions(Game1 game, SpriteBatch spriteBatch)
 {
     this.game = game;
     this.spriteBatch = spriteBatch;
     menuTitle = "Instructions";
     spriteFont = game.Content.Load<SpriteFont>("menufont");
     image = game.Content.Load<Texture2D>("MenuBG");
     string[] menuItems = { "Back to Menu" };
     menuComponent = new MenuComponent(game, spriteBatch, spriteFont, menuItems);
     game.Components.Add(menuComponent);
     menuComponent.Position = new Vector2(game.Window.ClientBounds.Width - game.Window.ClientBounds.Width / 4 , 50);
     imageRec = new Rectangle(0, 0, game.Window.ClientBounds.Width, game.Window.ClientBounds.Height);
 }