/// <summary> /// Initialise le bouton menu recommencer /// </summary> void InitialiserMenuRecommencer() { Vector2 PosTexte = new Vector2(Game.Window.ClientBounds.Width / 2, Game.Window.ClientBounds.Height / 2 - 150); AfficheurTexte = new AfficheurTexte(Game, Color.Red, PosTexte, "Vous avez échoué.", INTERVALLE_MOYEN); Game.Components.Add(AfficheurTexte); CalculerNbSoldats(DIMINUTION_SOLDTAS_RECOMMENCER); Boutton Recommencer = new Boutton(Game, "Recommencer", new Rectangle(Game.Window.ClientBounds.Width / 2 - LARGEUR_BOUTTON / 2, Game.Window.ClientBounds.Height / 2 - HAUTEUR_BOUTTON / 2, LARGEUR_BOUTTON, HAUTEUR_BOUTTON), Color.Blue, NOM_IMAGE_AVANT, NOM_IMAGE_APRÈS, NbSoldatsContinuer, PartieEnCours.GetNbSections(), INTERVALLE_MOYEN); Bouttons.Add(Recommencer); Bouttons.Add(Exit); Game.Components.Add(Recommencer); Game.Components.Add(Exit); Afficheur = new AfficheurNb(Game, Color.Red, CompteurNiveau, new Vector2(0, 0), "Niveau :", INTERVALLE_MOYEN); Game.Components.Add(Afficheur); PartieEnCours.DéfinirÉtatJeu(PartieEnCours.EstRéussi, false); }
/// <summary> /// Change le nombre de sections dans chaque niveau /// </summary> /// <returns>le nouveau nombre de section de niveaux</returns> int CalculerNbSection() { return(PartieEnCours.GetNbSections() + CompteurNiveau * AUGMENTATION_SECTION_NIVEAU); }