示例#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);
            graphics.PreferredBackBufferWidth  = TAILLEH;
            graphics.PreferredBackBufferHeight = TAILLEV;
            graphics.ApplyChanges();

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


            /// On initialise les différents objets du jeu
            /// lignes de briques
            /// la balle
            /// la raquette
            ///

            briquegrise    = new GameObjet(Content.Load <Texture2D>("brique_menthe"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            briquebleue    = new GameObjet(Content.Load <Texture2D>("briquegrise"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            briqueorange   = new GameObjet(Content.Load <Texture2D>("briquebleue"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            briquepoint    = new GameObjet(Content.Load <Texture2D>("briqueorange"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            briquerouge    = new GameObjet(Content.Load <Texture2D>("briquepoint"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            briqueviolet   = new GameObjet(Content.Load <Texture2D>("briqueviolet"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            unebriquenoire = new GameObjet(Content.Load <Texture2D>("briquelait"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero);
            coeurTexture   = Content.Load <Texture2D>("coeur");
            fond           = Content.Load <Texture2D>("fond1");

            // On charge la police

            this.textFont = Content.Load <SpriteFont>("font");

            // TODO: use this.Content to load your game content here
        }
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        ///
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            uneraquette = new GameObjet(Game.Content.Load <Texture2D>("Player"), this.position_depart, new Vector2(TAILLEX, TAILLEY), new Vector2(VITESSE_RAQUETTE, 0));

            base.LoadContent();
        }
示例#3
0
        /// <summary>
        /// Allows the game component to update itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        ///
        protected override void LoadContent()
        {
            try
            {
                spriteBatch = new SpriteBatch(GraphicsDevice);
            }
            catch (OutOfMemoryException e)
            {
                Console.WriteLine(e.Message);
            }

            uneballe = new GameObjet(Game.Content.Load <Texture2D>("ball"), this.position_depart, new Vector2(TAILLEX, TAILLEY), this.vitesse_initiale);

            base.LoadContent();
        }