/// <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 MurDeBriques(Game.Content.Load <Texture2D>("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 MurDeBriques(Game.Content.Load <Texture2D>("Ball1"), this.position_depart, new Vector2(TAILLEX, TAILLEY), this.vitesse_initiale); 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(); background_Sprite = Content.Load <Texture2D>("sc"); // 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 MurDeBriques(Content.Load <Texture2D>("br6"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquebleue = new MurDeBriques(Content.Load <Texture2D>("br4"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briqueorange = new MurDeBriques(Content.Load <Texture2D>("br2"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquejaune = new MurDeBriques(Content.Load <Texture2D>("br3"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquerouge = new MurDeBriques(Content.Load <Texture2D>("br7"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briqueviolet = new MurDeBriques(Content.Load <Texture2D>("br1"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); unebriquenoire = new MurDeBriques(Content.Load <Texture2D>("briquetransparente"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquegreen = new MurDeBriques(Content.Load <Texture2D>("br2"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briqueyellow = new MurDeBriques(Content.Load <Texture2D>("br4"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); briquecyan = new MurDeBriques(Content.Load <Texture2D>("br8"), new Vector2(0f, 0f), new Vector2(TAILLEBRIQUEX, TAILLEBRIQUEY), Vector2.Zero); fond = Content.Load <Texture2D>("bck1"); // On charge la police this.textFont = Content.Load <SpriteFont>("font"); // TODO: use this.Content to load your game content here }