private void LockIA_lettres(float time) { _timer_lock += time; if (debut_choix) { int caca = random.Next(1, 3); if (caca == 1) { joueur = true; _timer_lock = 0; int pd = random.Next(1, 3); AjoutLettre(pd, plaque1); } else { joueur = true; } debut_choix = false; } else if (_timer_lock > 500f && !joueur) { int pd = random.Next(1, 3); Plaques plaque = PlaqueAjout(); AjoutLettre(pd, plaque); joueur = true; } if (plaque10.disponible) { nouvellePartie = false; _lancerTimer = true; } }
private void DrawPlaqueMethod(Plaques plaque) { if (!plaque.utiliser) { ScreenManager.SpriteBatch.Draw(plaque_lettre, plaque.position, Color.White); ScreenManager.SpriteBatch.DrawString(Lettre_plaque_font, plaque.lettre_correspond, new Vector2(plaque.position.X + _plaqueWidth / 2 - (Lettre_plaque_font.MeasureString(plaque.lettre_correspond).X / 2), plaque.position.Y + _plaqueHeight / 2 - (Lettre_plaque_font.MeasureString(plaque.lettre_correspond).Y / 2)), Color.Black); } else { ScreenManager.SpriteBatch.Draw(plaque_lettre, plaque.position, opacity_plaque); ScreenManager.SpriteBatch.DrawString(Lettre_plaque_font, plaque.lettre_correspond, new Vector2(plaque.position.X + _plaqueWidth / 2 - (Lettre_plaque_font.MeasureString(plaque.lettre_correspond).X / 2), plaque.position.Y + _plaqueHeight / 2 - (Lettre_plaque_font.MeasureString(plaque.lettre_correspond).Y / 2)), opacity_chiffre); } }
private void AjoutLettre(int typelettre, Plaques plaque) { if (typelettre == 1) { int k = random.Next(0, voyelle.Count); plaque.lettre_correspond = voyelle.ElementAt(k); voyelle.RemoveAt(k); plaque.disponible = true; } else { int k = random.Next(0, consonne.Count); plaque.lettre_correspond = consonne.ElementAt(k); consonne.RemoveAt(k); plaque.disponible = true; } }
private void AjoutLettre(Plaques plaque) { _erreur4lettres = false; plaque.utiliser = true; if (mots_tab[0] == null) { mots_tab.SetValue(plaque.lettre_correspond, 0); } else if (mots_tab[1] == null) { mots_tab.SetValue(plaque.lettre_correspond, 1); } else if (mots_tab[2] == null) { mots_tab.SetValue(plaque.lettre_correspond, 2); } else if (mots_tab[3] == null) { mots_tab.SetValue(plaque.lettre_correspond, 3); } else if (mots_tab[4] == null) { mots_tab.SetValue(plaque.lettre_correspond, 4); } else if (mots_tab[5] == null) { mots_tab.SetValue(plaque.lettre_correspond, 5); } else if (mots_tab[6] == null) { mots_tab.SetValue(plaque.lettre_correspond, 6); } else if (mots_tab[7] == null) { mots_tab.SetValue(plaque.lettre_correspond, 7); } else if (mots_tab[8] == null) { mots_tab.SetValue(plaque.lettre_correspond, 8); } else if (mots_tab[9] == null) { mots_tab.SetValue(plaque.lettre_correspond, 9); } }