private void P_focusedBibles_Load(object sender, EventArgs e) { // this.AddOwnedForm(Gamesettings); //indica que este va a ser el papa del form settings lab_Wins_P1.Text = Convert.ToString(wins_01); lab_Wins_P2.Text = Convert.ToString(wins_02); tlyo_Wins_P1.Visible = true; tlyo_Wins_P2.Visible = false; lab_Rounds_Left.Text = round + "/" + numRounds; lab_Rounds_Right.Text = round + "/" + numRounds; lab_Difficulty.Text = difficulty; lab_LifesNum.Text = Convert.ToString(lifes_1); lab_LifesNum2.Text = Convert.ToString(lifes_2); lab_Player1.Text = player1; lab_Player2.Text = player2; countDownTimer2 = time2Answer; Timer_2Answer.Start(); banner = "Round" + round; reproducirSonido("levelclearer.wav", true); objEntidad.dificultad = difficulty; noRepetir = new int?[objNego.N_NumFilas()]; // el tamaño es el tamaño del numero de filas noRepetir_PorDificultad = new int?[objNego.N_NumFilas_PorDificultad(objEntidad)]; // el tamaño es el tamaño del numero de filas lista_porDificultad = new E_focusedBible[objNego.N_NumFilas_PorDificultad(objEntidad)]; Llenar_listaPorDificultad(objEntidad); listarFocusedBible(objEntidad); focoRbtn(); bloquear_Btn_Submit(); }
private void P_focusedBibles_Activated(object sender, EventArgs e) { if (E_focusedBible.deSettings == true) // para saber si se acaba de salir de settings a pantalla de juego { Timer_2Answer.Start(); if (sonido != null) { sonido.PlayLooping(); } E_focusedBible.deSettings = false; // desactivando ya que desde este momento no se acaba de entrar } }
void PlayerFocus(int turno) { if (turno == 1) { // si hay cambio de turno y pasage no es igual a N/A o "", Ni se ha acabado el comodin passage if (passage != "N/A" && passage != "" && lab_Passage_1.Text != "0") { lab_Passage_1.Enabled = true; } //para poder cambiar el tamaño de la fuente hay que instanciarla y pasarle los parametros siguientes. lab_Player1.Font = new Font(lab_Player1.Font.Name, 20, lab_Player1.Font.Style, lab_Player1.Font.Unit); //para cambiar el color a gris lab_Player1.ForeColor = Color.FromArgb(228, 161, 24); lab_Player2.Font = new Font(lab_Player2.Font.Name, 10, lab_Player2.Font.Style, lab_Player2.Font.Unit); //para cambiar el color a orange lab_Player2.ForeColor = Color.FromArgb(237, 237, 237); cambiarColoryJugador(turno); Timer_2Answer.Start(); } else // si el turno es 2 { // si hay cambio de turno y pasage no es igual a N/A o "", Ni se ha acabado el comodin passage if (passage != "N/A" && passage != "" && lab_Passage_2.Text != "0") { lab_Passage_2.Enabled = true; } lab_Player2.Font = new Font(lab_Player2.Font.Name, 20, lab_Player2.Font.Style, lab_Player2.Font.Unit); lab_Player2.ForeColor = Color.FromArgb(228, 161, 24); lab_Player1.Font = new Font(lab_Player1.Font.Name, 10, lab_Player1.Font.Style, lab_Player1.Font.Unit); lab_Player1.ForeColor = Color.FromArgb(237, 237, 237); cambiarColoryJugador(turno); Timer_2Answer.Start(); } }
void reset_PlayAgain() { Timer_2Answer.Stop(); //detener conteo countDownTimer = 3; countDownTimer2 = time2Answer; countDownTimer3 = 2; if (restart == true) { restart = false; i = 0; countUp = 0; enumerate = 1; // para ponerle número a las preguntas round = 1; turno = 1; wins_01 = 0; wins_02 = 0; score_1 = 0; score_2 = 0; passage = ""; lab_Rounds_Left.Text = round + "/" + numRounds; lab_Rounds_Right.Text = round + "/" + numRounds; lab_Wins_P1.Text = Convert.ToString(wins_01); lab_Wins_P2.Text = Convert.ToString(wins_02); Array.Clear(noRepetir, 0, noRepetir.Length); // vaciar arreglo Array.Clear(noRepetir_PorDificultad, 0, noRepetir_PorDificultad.Length); // vaciar arreglo } lifes_1 = 3; lifes_2 = 3; countDownComodin_1 = 3; countDownComodin_2 = 3; countDownPassage_1 = 3; countDownPassage_2 = 3; Lab_Passage_Shown_1.Text = ""; Timer_2Answer.Start(); if (banner == lab_Player1.Text + " Wins" || banner == lab_Player2.Text + " Wins" || banner == "It's a Draw!") { AfterCountDown(true); banner = "Round" + round; // resetear banner } lab_LifesNum.Text = Convert.ToString(lifes_1); lab_LifesNum2.Text = Convert.ToString(lifes_2); lab_ScoreNum.Text = Convert.ToString(score_1); lab_ScoreNum2.Text = Convert.ToString(score_2); lab_50_1.Text = "+3"; lab_50_2.Text = "+3"; pbx_50_1.Enabled = true; pbx_50_2.Enabled = true; lab_50_1.Enabled = true; lab_50_2.Enabled = true; lab_Passage_1.Text = "+3"; lab_Passage_2.Text = "+3"; pbx_Passage_1.Enabled = true; pbx_Passage_2.Enabled = true; lab_Passage_1.Enabled = true; lab_Passage_2.Enabled = true; pbx_Passage_1.Image = Properties.Resources.Passage_Mouse_Leave; pbx_Passage_2.Image = Properties.Resources.Passage_Mouse_Leave; }