示例#1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            for (int i = 0; i < spriteSheetBackground.Length / 20; i++)
            {
                for (int j = 0; j < spriteSheetBackground.Length / 20; j++)
                {
                    spriteSheetBackground[i, j] = this.Content.Load <Texture2D>("Landscape/landscape_21");
                }
            }
            // TODO: use this.Content to load your game content here

            enemy = new Enemy(new Vector2(700f, 25f));
            enemy.LoadContent(Content);
            enemyList = new List <Enemy>();
            enemyList.Add(enemy);
            gameManager = new GameManager();
            gameManager.LoadContent(Content);
            SpawnEnemyEvent += new EventHandler(gameManager.SpawnEnemy);
        }
示例#2
0
        // 0=top , 1=middle , 2=bottom
        private void loadStandardEnemy(int enemyPos)
        {
            if (enemyPos == 0)
            {
                Enemy newEn = new Enemy(this.Game, gr_enemyBlue, gr_projectile1, au_projectile1, au_explosion, topPos, gr_explosions, standardSpeed,
                                        standardGunSpeed, enemyPath, standardEnemySize);
                newEn.LoadContent(content);
                enemies.Add(newEn);
            }
            else if (enemyPos == 1)
            {
                Enemy newEn = new Enemy
                                  (this.Game, gr_enemyBlue, gr_projectile1, au_projectile1, au_explosion, middlePos, gr_explosions, standardSpeed,
                                  standardGunSpeed, enemyPath, standardEnemySize);
                newEn.LoadContent(content);
                enemies.Add(newEn);
            }
            else if (enemyPos == 2)
            {
                Enemy newEn = new Enemy
                                  (this.Game, gr_enemyBlue, gr_projectile1, au_projectile1, au_explosion, bottomPos, gr_explosions, standardSpeed,
                                  standardGunSpeed, enemyPath, standardEnemySize);
                newEn.LoadContent(content);
                enemies.Add(newEn);
            }

            /*   enemies.Add(new Enemy
             *     (this.Game, gr_enemyBlue, gr_projectile1, au_projectile1, au_explosion, topPos,gr_explosions, standardSpeed,
             *     standardGunSpeed, enemyPath, standardEnemySize));
             * else if (enemyPos == 1)
             * {
             * enemies.Add(new Enemy
             *     (this.Game, gr_enemyBlue, gr_projectile1, au_projectile1, au_explosion, middlePos, gr_explosions, standardSpeed,
             *     standardGunSpeed, enemyPath, standardEnemySize));
             * }
             * else if (enemyPos == 2)
             * enemies.Add(new Enemy
             *     (this.Game, gr_enemyBlue, gr_projectile1, au_projectile1, au_explosion, bottomPos,gr_explosions, standardSpeed,
             *     standardGunSpeed, enemyPath, standardEnemySize));*/
        }