コード例 #1
0
ファイル: SpriteManager.cs プロジェクト: snarhov/SpaceBattles
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(Game.GraphicsDevice);
            gameOverFont = Game.Content.Load<SpriteFont>(@"GameOver");
            inGameFont = Game.Content.Load<SpriteFont>(@"inGameFont");

            hpBar = new ProgressBar(new Vector2(game.Window.ClientBounds.Width - barFieldWidth + 10, game.Window.ClientBounds.Height - 40), Game.Content.Load<Texture2D>(@"Images/hpBar2"), Game.Content.Load<Texture2D>(@"Images/ProgressBarBackground2"), spriteBatch);
            expBar = new ProgressBar(new Vector2(game.Window.ClientBounds.Width - barFieldWidth +10 + (int)(hpBar.GetTextureWidth()*1.2), game.Window.ClientBounds.Height - 40), Game.Content.Load<Texture2D>(@"Images/expBar"), Game.Content.Load<Texture2D>(@"Images/ProgressBarBackground2"), spriteBatch);
            heatingBar = new ProgressBar(new Vector2(game.Window.ClientBounds.Width - barFieldWidth + 10 + (int)(hpBar.GetTextureWidth() * 1.2) + (int)(expBar.GetTextureWidth() * 1.2), game.Window.ClientBounds.Height - 40), Game.Content.Load<Texture2D>(@"Images/heatingBar"), Game.Content.Load<Texture2D>(@"Images/ProgressBarBackground2"), spriteBatch);

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 5, 7));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb0"),
                   new Point(5, 7), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 20, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 5, 9));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb1"),
                    new Point(5, 9), 10, new Point(0, 0),
                    new Point(1, 1), new Vector2(0, -2), 34, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 5, 12));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb2"),
                   new Point(5, 12), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 50, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 10, 14));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/Bomb3"),
                   new Point(10, 14), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 100, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 4, 11));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/freeze0"),
                   new Point(4, 11), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 25, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 10, 14));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/freeze1"),
                   new Point(10, 14), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 125, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 11, 42));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/freeze2"),
                   new Point(11, 42), 10, new Point(0, 0),
                   new Point(1, 1), new Vector2(0, -2), 500, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 11,11));
            bombsList.Add(new Bombs(Game.Content.Load<Texture2D>(@"Images/bombs/greenCircle"),
                   new Point(11, 11), 10, new Point(0, 0),
                   new Point(4, 1), new Vector2(0, -2), 100, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0,0,19,27));
            enemyList.Add(new Enemy(Game.Content.Load<Texture2D>(@"Images/enemys/enemy1"),
                new Point(19, 27), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(1.5f,1.5f), 100, 0, 3500, new Vector2(9,27), 30, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 37, 28));
            enemyList.Add(new Enemy(Game.Content.Load<Texture2D>(@"Images/enemys/enemy2"),
                new Point(37, 28), 10, new Point(0, 0),
                new Point(1, 1), new Vector2(1, 1), 200, 4, 4500, new Vector2(19, 27), 60, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 48, 49));
            enemyList.Add(new Enemy(Game.Content.Load<Texture2D>(@"Images/enemys/bumerang0"),
                new Point(48, 49), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(3, 3), 400, 6, -1, new Vector2(24, 27), 90, rectangleList));

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 118, 138));
            playerShip = new UserControlledSprite(
                Game.Content.Load<Texture2D>(@"Images/PlayerShipAnim"),
                Vector2.Zero, new Point(118, 138), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(4, 4), rectangleList);

            rectangleList = new List<Rectangle>();
            rectangleList.Clear();
            rectangleList.Add(new Rectangle(0, 0, 58, 58));
            bonusList.Add(new Bonus(
                Game.Content.Load<Texture2D>(@"Images/bonuses/bonusLifeCh"),
                new Point(58, 58), 10, new Point(0, 0),
                new Point(4, 1), new Vector2(1, 1), 100, 0, rectangleList));

            base.LoadContent();
        }