Example #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);

            target = new RenderTarget2D(GraphicsDevice, screenX, screenY); //resolution 3200 by 1800
            Bullet.LoadContent(Content);                                   //loads bullet image so that each bullet can use the same static image- saves memory

            //Enemies and Enemy bullets
            T1Bullet.LoadContent(Content);
            T2Bullet.LoadContent(Content);
            BBullet.LoadContent(Content);
            Type1.LoadContent(Content);
            Type2.LoadContent(Content);


            Health.LoadContent(Content);
            Shield.LoadContent(Content);

            // TODO: use this.Content to load your game content here
            //normal background image
            background = Content.Load <Texture2D>("Background");
            //status bars
            healthBar  = Content.Load <Texture2D>("healthBar");
            shieldBar  = Content.Load <Texture2D>("shieldBar");
            chargeBar  = Content.Load <Texture2D>("chargeBar");
            reloadBar  = Content.Load <Texture2D>("reloadBar");
            reloadBarF = Content.Load <Texture2D>("reloadBarF");
            BBar       = Content.Load <Texture2D>("BBar");
            //howto images
            howK = Content.Load <Texture2D>("howtoK");
            howC = Content.Load <Texture2D>("howtoC");


            //lose image
            end = Content.Load <Texture2D>("gg");
            //win image
            win = Content.Load <Texture2D>("win");
            p1.LoadContent(Content);
            t.LoadContent(Content);

            //loading text
            write  = Content.Load <SpriteFont>("write");
            big    = Content.Load <SpriteFont>("bigWrite");
            myFont = Content.Load <SpriteFont>("myFont");

            //spawns an enemy at each gate
            Type1 t1; Type1 t2; Type1 t3; Type1 t4;

            t1 = new Type1((screenX / 2) - 150, 0);             //top gate
            t2 = new Type1(0, 600);                             //left gate
            t3 = new Type1(screenX - 335, 600);                 //right gate
            t4 = new Type1((screenX / 2) - 150, screenY - 460); //bottom gate
            enemies1.Add(t1); enemies1.Add(t2); enemies1.Add(t3); enemies1.Add(t4);

            Sound.LoadContent(Content);
        }