Beispiel #1
0
 private void GérerTransitionDécompte()
 {
     if (!DécompteInitial.EstActif)
     {
         État                          = ÉtatsJeu.JEU;
         Joueur.EstActif               = true;
         DécompteInitial.Enabled       = false;
         DécompteInitial.Visible       = false;
         NetworkManager.TempsDeCourseJ = new ChronoAugmente(Game, new TimeSpan(0), "Arial", new Vector2(Game.Window.ClientBounds.Width / 2, 30), "Blanc", true, false, Color.White, INTERVALLE_MAJ);
         Game.Components.Add(NetworkManager.TempsDeCourseJ);
         MenuDesOptions.DésactiverDifficulté();
         AffNbTours = new Titre(Game, "Tour : 1", "Arial20", new Vector2(Game.Window.ClientBounds.Width / 15, Game.Window.ClientBounds.Height / 18), "Blanc", false, Color.White);
         Game.Components.Add(AffNbTours);
     }
 }
        void Activer()
        {
            NetworkManager = Game.Services.GetService(typeof(Réseautique)) as Réseautique; //on le fait plusieurs fois... PAS GRAVE?
            //Game.Components.Remove(Gagnant);
            //Game.Components.Remove(Perdant);

            Pseudonymes[0] = NetworkManager.PseudonymeJ;
            Pseudonymes[1] = NetworkManager.PseudonymeE;
            Temps[0]       = NetworkManager.TempsDeCourseJ.ValeurTimer;
            Temps[1]       = NetworkManager.TempsDeCourseE;
            IndexGagnant   = Convert.ToInt32(Temps[0] > Temps[1]);

            Gagnant = new Titre(Game, Pseudonymes[IndexGagnant] + " - " + Temps[IndexGagnant].ToString("mm':'ss','ff"), "Arial", new Vector2(Game.Window.ClientBounds.Width / 2, Game.Window.ClientBounds.Height / 2), "Blanc", false, Color.White);
            Game.Components.Add(Gagnant);
            Gagnant.DrawOrder = 2;

            Perdant = new Titre(Game, Pseudonymes[(IndexGagnant + 1) % 2] + " - " + Temps[(IndexGagnant + 1) % 2].ToString("mm':'ss','ff"), "Arial", new Vector2(Game.Window.ClientBounds.Width / 2, 3 * Game.Window.ClientBounds.Height / 5), "Blanc", false, Color.White);
            Game.Components.Add(Perdant);
            Perdant.DrawOrder = 2;

            Félicitation = new Titre(Game, "Félicitations " + Pseudonymes[IndexGagnant] + '!', "Arial", new Vector2(Game.Window.ClientBounds.Width / 2, 5 * Game.Window.ClientBounds.Height / 6), "Blanc", false, Color.White);
            Game.Components.Add(Félicitation);
            Félicitation.DrawOrder = 2;
        }