Esempio n. 1
0
 void AfficherBoutons(int indiceA, int indiceB)
 {
     for (int i = indiceA; i < indiceB; i++)
     {
         ListeDesBoutons.ElementAt(i).Visible = true;
         ListeDesBoutons.ElementAt(i).Enabled = true;
     }
 }
Esempio n. 2
0
 void VoilerBoutons(int indiceA, int indiceB)
 {
     for (int i = indiceA; i < indiceB; i++)
     {
         ListeDesBoutons.ElementAt(i).Visible = false;
         ListeDesBoutons.ElementAt(i).Enabled = false;
     }
 }
Esempio n. 3
0
        void CréerMP()
        {
            int   indice   = 2;
            float valeur   = GraphicsDevice.Viewport.Height / indice / 3;
            float y        = GraphicsDevice.Viewport.Height / 1.8f;
            float x        = GraphicsDevice.Viewport.Width / 4;
            float longueur = GraphicsDevice.Viewport.Width / 5;
            float hauteur  = GraphicsDevice.Viewport.Width / (3 * indice) - 1;

            Components.Add(B1 = new Bouton(this, "button", "Arial", text1, new Vector2(x, y), new Vector2(2 * longueur, hauteur / 2)));
            y += valeur;
            Components.Add(B2 = new Bouton(this, "button", "Arial", text2, new Vector2(x, y), new Vector2(longueur, hauteur / 2)));
            ListeDesBoutons.Add(B1);
            ListeDesBoutons.Add(B2);
        }
Esempio n. 4
0
        void CréerChoixPause()
        {
            int   indice   = 2;
            float valeur   = GraphicsDevice.Viewport.Height / indice / 3;
            float y        = GraphicsDevice.Viewport.Height / 1.6f;
            float x        = GraphicsDevice.Viewport.Width / 4;
            float longueur = GraphicsDevice.Viewport.Width / 5;
            float hauteur  = GraphicsDevice.Viewport.Width / (3 * indice) - 1;

            Components.Add(B6 = new Bouton(this, "button", "Arial", msgPause1, new Vector2(x, y), new Vector2(2 * longueur, hauteur / 3)));
            y += valeur;
            Components.Add(B7 = new Bouton(this, "button", "Arial", msgPause2, new Vector2(x, y), new Vector2(2 * longueur, hauteur / 3)));

            ListeDesBoutons.Add(B6);
            ListeDesBoutons.Add(B7);
            VoilerBoutons(5, 7);
        }
Esempio n. 5
0
        void CréerOptions()
        {
            int   indice   = 3;
            float valeur   = GraphicsDevice.Viewport.Height / indice;
            float y        = 0;
            float x        = GraphicsDevice.Viewport.Width / 2;
            float longueur = GraphicsDevice.Viewport.Width / 5;
            float hauteur  = GraphicsDevice.Viewport.Width / (3 * indice) - 1;

            Components.Add(B3 = new Bouton(this, "button", "Arial", text3, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B4 = new Bouton(this, "button", "Arial", text4, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B5 = new Bouton(this, "button", "Arial", text5, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            ListeDesBoutons.Add(B3);
            ListeDesBoutons.Add(B4);
            ListeDesBoutons.Add(B5);
            VoilerBoutons(2, 5);
        }
Esempio n. 6
0
        void CréerChoixMusique()
        {
            int   indice   = 4;
            float valeur   = GraphicsDevice.Viewport.Height / indice;
            float y        = 0;
            float x        = GraphicsDevice.Viewport.Width / 2;
            float longueur = GraphicsDevice.Viewport.Width / 5;
            float hauteur  = GraphicsDevice.Viewport.Width / (3 * indice) - 1;

            Components.Add(B16 = new Bouton(this, "button", "Arial", tune1, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B17 = new Bouton(this, "button", "Arial", tune2, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B18 = new Bouton(this, "button", "Arial", tune3, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B19 = new Bouton(this, "button", "Arial", tune4, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            ListeDesBoutons.Add(B16);
            ListeDesBoutons.Add(B17);
            ListeDesBoutons.Add(B18);
            ListeDesBoutons.Add(B19);
            VoilerBoutons(15, 19);
        }
Esempio n. 7
0
        void CréerChoixTemps()
        {
            int   indice   = 4;
            float valeur   = GraphicsDevice.Viewport.Height / indice;
            float y        = 0;
            float x        = GraphicsDevice.Viewport.Width / 2;
            float longueur = GraphicsDevice.Viewport.Width / 5;
            float hauteur  = GraphicsDevice.Viewport.Width / (3 * indice) - 1;

            Components.Add(B12 = new Bouton(this, "button", "Arial", temps1, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B13 = new Bouton(this, "button", "Arial", temps2, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B14 = new Bouton(this, "button", "Arial", temps3, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B15 = new Bouton(this, "button", "Arial", temps4, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            ListeDesBoutons.Add(B12);
            ListeDesBoutons.Add(B13);
            ListeDesBoutons.Add(B14);
            ListeDesBoutons.Add(B15);
            VoilerBoutons(11, 15);
        }
Esempio n. 8
0
        void CréerChoixClrsÉchi()
        {
            int   indice   = 4;
            float valeur   = GraphicsDevice.Viewport.Height / indice;
            float y        = 0;
            float x        = GraphicsDevice.Viewport.Width / 2;
            float longueur = GraphicsDevice.Viewport.Width / 5;
            float hauteur  = GraphicsDevice.Viewport.Width / (3 * indice) - 1;

            Components.Add(B8 = new Bouton(this, "button", "Arial", clr1, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B9 = new Bouton(this, "button", "Arial", clr2, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B10 = new Bouton(this, "button", "Arial", clr3, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            y += valeur;
            Components.Add(B11 = new Bouton(this, "button", "Arial", clr4, new Vector2(x, y), new Vector2(2 * longueur, hauteur)));
            ListeDesBoutons.Add(B8);
            ListeDesBoutons.Add(B9);
            ListeDesBoutons.Add(B10);
            ListeDesBoutons.Add(B11);
            VoilerBoutons(7, 11);
        }
Esempio n. 9
0
        void DéterminerSettings()
        {
            int indexClrÉchi     = ListeDesBoutons.FindIndex(7, 4, x => (x.Clicked == true));
            int indexTempsPartie = ListeDesBoutons.FindIndex(11, 4, x => (x.Clicked == true));
            int indexMusique     = ListeDesBoutons.FindIndex(15, 4, x => (x.Clicked == true));



            switch (indexClrÉchi)
            {
            case 7:
                CouleursÉchiquier[0] = Color.White;
                CouleursÉchiquier[1] = Color.Gray;
                CouleursÉchiquier[2] = Color.Black;
                break;

            case 8:
                CouleursÉchiquier[0] = Color.White;
                CouleursÉchiquier[1] = Color.Green;
                CouleursÉchiquier[2] = Color.Black;
                break;

            case 9:
                CouleursÉchiquier[0] = Color.White;
                CouleursÉchiquier[1] = Color.Red;
                CouleursÉchiquier[2] = Color.Black;
                break;

            case 10:
                CouleursÉchiquier[0] = Color.White;
                CouleursÉchiquier[1] = Color.Pink;
                CouleursÉchiquier[2] = Color.Black;
                break;
            }
            switch (indexTempsPartie)
            {
            case 11:
                TempsDePartie = 15 * 60;
                break;

            case 12:
                TempsDePartie = 30 * 60;
                break;

            case 13:
                TempsDePartie = 45 * 60;
                break;

            case 14:
                TempsDePartie = 60 * 60;
                break;
            }
            switch (indexMusique)
            {
            case 15:
                Chanson          = GestionnaireDeSons.Find("the_gael").CreateInstance();
                Chanson.IsLooped = true;
                break;

            case 16:
                Chanson          = GestionnaireDeSons.Find("Mozart_Lacrimosa").CreateInstance();
                Chanson.IsLooped = true;
                break;

            case 17:
                Chanson          = GestionnaireDeSons.Find("Tunak_Tunak").CreateInstance();
                Chanson.IsLooped = true;
                break;

            case 18:
                Chanson          = GestionnaireDeSons.Find("Muse_Resistance").CreateInstance();
                Chanson.IsLooped = true;
                break;
            }
        }