/// <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); // this.Law.Load(spriteBatch); this.Chopper.Load(spriteBatch); MediaPlayer.Play(textures.stars); Coeurs = new Entity(); metters = 0; GameOver = false; Win = false; keySpacePressed = false; seconde = 0; transition = true; score = new spritefont(textures.score, new Vector2(425, 40), metters.ToString()); string texteD = "Vous etes mort"; string texteV = "Gagne !"; defeat = new spritefont(textures.score, new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2), texteD); victoire = new spritefont(textures.score, new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2), texteV); defeat.color = Color.Red; victoire.color = Color.Green; Coeurs.setTexture(textures.Hearth01); Level01 = new levels(textures.Level01, Chopper); level01_parallax = new levels(textures.Level01, Chopper); Level01.setPosition(); wall.Load(); // TODO: use this.Content to load your game content here }
//Méthode pour empêcher le personnage de sortir de la fênetre public void LevelBorder(levels level) { if (level.BorderRight.Intersects(this.Collision)) { wallRight = true; } else if (level.BorderLeft.Intersects(this.Collision)) { wallLeft = true; } else { wallLeft = false; wallRight = false; } }