Esempio n. 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);

            // STUDENTS: load teddy and pickup sprites
            teddySprite  = Content.Load <Texture2D>(@"graphics\teddybear");
            pickupSprite = Content.Load <Texture2D>(@"graphics\pickup");

            // STUDENTS: create teddy object centered in window
            teddy = new TeddyBear(teddySprite, new Vector2(WindowWidth / 2, WindowHeight / 2));
        }
Esempio n. 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);

            // STUDENTS: load teddy and pickup sprites
            teddySprite  = Content.Load <Texture2D>(@"graphics/teddybear");
            pickupSprite = Content.Load <Texture2D>(@"graphics/pickup");

            // STUDENTS: create teddy object centered in window
            float   x        = WindowWidth / 2 - teddySprite.Width / 2;
            float   y        = WindowHeight / 2 - teddySprite.Height / 2;
            Vector2 location = new Vector2(x, y);

            teddy = new TeddyBear(teddySprite, location);
        }
        /// <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);

            // STUDENTS: load teddy and pickup sprites

            //loading sprites
            teddySprite = Content.Load<Texture2D>(@"teddybear");
            pickupSprite = Content.Load<Texture2D>(@"pickup");

            // STUDENTS: create teddy object centered in window

            //centering teddy
            teddy = new TeddyBear(teddySprite,
                new Vector2(WindowWidth / 2 - teddySprite.Width / 2, WindowHeight / 2 - teddySprite.Height / 2));
        }