/// <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);

            EffectManager.Initialize(this.graphics, this.Content);
            EffectManager.LoadContent();

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            planetSheet = Content.Load <Texture2D>(@"Textures\PlanetSheet");
            levelScreen = Content.Load <Texture2D>(@"Textures\LevelSelect");
            ccViewer    = Content.Load <Texture2D>(@"Textures\CheatCodes");
            credits     = Content.Load <Texture2D>(@"Textures\Credits");
            weedBG      = Content.Load <Texture2D>(@"Textures\420");


            planetManager = new PlanetManager(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                new Vector2(0, 40f),
                planetSheet);


            starField = new StarField(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                200,
                new Vector2(0, 30f),
                spriteSheet,
                new Rectangle(0, 450, 2, 2));

            asteroidManager = new AsteroidManager(
                10,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                10,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(170, 265, 50, 85),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }
示例#2
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);

            titleScreen = Content.Load <Texture2D>(@"Textures\TitleScreen");
            spriteSheet = Content.Load <Texture2D>(@"Textures\spriteSheet");
            planetSheet = Content.Load <Texture2D>(@"Textures\Planets");
            Guydish     = Content.Load <Texture2D>(@"Textures\Guydish");
            Winner      = Content.Load <Texture2D>(@"Textures\Winner");
            Boss        = Content.Load <Texture2D>(@"Textures\Boss");

            planetManager = new PlanetManager(
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height,
                new Vector2(0, 40f),
                planetSheet);


            starFields = new List <StarField>();

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               50,
                               new Vector2(0, 40f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               150,
                               new Vector2(0, 30f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               150,
                               new Vector2(0, 15f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            starFields.Add(new StarField(
                               this.Window.ClientBounds.Width,
                               this.Window.ClientBounds.Height,
                               50,
                               new Vector2(0, 5f),
                               spriteSheet,
                               new Rectangle(0, 450, 2, 2)));

            asteroidManager = new AsteroidManager(
                5,
                spriteSheet,
                new Rectangle(0, 0, 50, 50),
                20,
                this.Window.ClientBounds.Width,
                this.Window.ClientBounds.Height);

            playerManager = new PlayerManager(
                spriteSheet,
                new Rectangle(7, 146, 62, 62),
                1,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            enemyManager = new EnemyManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            bossManager = new BossManager(
                spriteSheet,
                new Rectangle(0, 200, 50, 50),
                6,
                playerManager,
                new Rectangle(
                    0,
                    0,
                    this.Window.ClientBounds.Width,
                    this.Window.ClientBounds.Height));

            explosionManager = new ExplosionManager(
                spriteSheet,
                new Rectangle(0, 100, 50, 50),
                3,
                new Rectangle(0, 450, 2, 2));

            collisionManager = new CollisionManager(
                asteroidManager,
                playerManager,
                enemyManager,
                explosionManager);

            SoundManager.Initialize(Content);

            pericles14 = Content.Load <SpriteFont>(@"Fonts\Pericles14");


            // TODO: use this.Content to load your game content here
        }