/// <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 ObjetAnime(Game.Content.Load <Texture2D>(@"mesImages\raquette3"), this.position_depart, new Vector2(TAILLEX, TAILLEY), new Vector2(VITESSE_RAQUETTE, 0)); base.LoadContent(); }
/// <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 ObjetAnime(Game.Content.Load <Texture2D>(@"mesimages\balle3"), this.position_depart, new Vector2(TAILLEX, TAILLEY), this.vitesse_initiale); soundRaquette = Game.Content.Load <SoundEffect>(@"sounds\collisionRaquette"); soundMur = Game.Content.Load <SoundEffect>(@"sounds\collisionMur"); soundBrique = Game.Content.Load <SoundEffect>(@"sounds\collisionBrique"); // on met à jour la Bounding Box base.LoadContent(); }
/// <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 ObjetAnime(Content.Load <Texture2D>(@"mesimages\brique0"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquebleue = new ObjetAnime(Content.Load <Texture2D>(@"mesimages\brique1"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briqueorange = new ObjetAnime(Content.Load <Texture2D>(@"mesimages\brique3"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquepoint = new ObjetAnime(Content.Load <Texture2D>(@"mesimages\brique4"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquerouge = new ObjetAnime(Content.Load <Texture2D>(@"mesimages\brique5"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briqueviolet = new ObjetAnime(Content.Load <Texture2D>(@"mesimages\brique6"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); unebriquenoire = new ObjetAnime(Content.Load <Texture2D>(@"mesimages\briquetransparente"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); fond = Content.Load <Texture2D>(@"mesImages\fond2"); musique = Content.Load <Song>(@"sounds\musique2"); MediaPlayer.Play(musique); MediaPlayer.Volume = 0.5f; MediaPlayer.IsRepeating = true; // On charge la police this.textFont = Content.Load <SpriteFont>(@"font\aFont"); // TODO: use this.Content to load your game content here }