private void FrmQuestion_Load(object sender, EventArgs e) { decCurrent_Time = decTIME_SECONDS; PlaySound.PlaySounds(Properties.Resources.JeopardyMain); intCurrentTeam = 2; txtQuestion.Focus(); tmrMain.Start(); }
private void Buzzer(int intTeam) { tmrMain.Stop(); tmrPlayer.Start(); decCurrent_Time = decTIME_PLAYER; PlaySound.PlaySounds(Properties.Resources.Buzzed); intCurrentTeam = intTeam; txtTeam.Text = string.Format(strBUZZED, FrmJeopardy.Teams[intTeam].strName); btnShowAnswer.Enabled = true; btnShowAnswer.Focus(); }
private void ClickQuestion(object sender, EventArgs e) { if (sender is Button) { FrmQuestion frmQuestion = new FrmQuestion(); Button btnCurrent = (sender as Button); string strCategory = "Null"; bool bolDblJeopardy = false; intPointValue = Convert.ToInt16(btnCurrent.Text); if (btnCurrent.Name.Contains("Cat1")) { strCategory = CategoryList.strCategoryOne; } if (btnCurrent.Name.Contains("Cat2")) { strCategory = CategoryList.strCategoryTwo; } if (btnCurrent.Name.Contains("Cat3")) { strCategory = CategoryList.strCategoryThree; } if (btnCurrent.Name.Contains("Cat4")) { strCategory = CategoryList.strCategoryFour; } if (btnCurrent.Tag != null && (string)btnCurrent.Tag == "Double") { PlaySound.PlaySounds(Properties.Resources.DailyDouble); intPointValue *= intDblJeopardyMultiplier; bolDblJeopardy = true; if (MessageBox.Show(strDOUBLE_JEOPARDY, strDOUBLE_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) == DialogResult.OK) { if (PlaySound.spMain != null) { PlaySound.spMain.Stop(); } btnCurrent.Enabled = false; frmQuestion.InitializeQuestion(GetQuestion(strCategory, intPointValue, bolDblJeopardy, bolIsRotated)); frmQuestion.Show(); } } else { btnCurrent.Enabled = false; frmQuestion.InitializeQuestion(GetQuestion(strCategory, intPointValue, bolDblJeopardy, bolIsRotated)); frmQuestion.Show(); } } }
private void tmrPlayer_Tick(object sender, EventArgs e) { decCurrent_Time -= .1m; lblTimer.Text = strTIMER + decCurrent_Time.ToString(); if (decCurrent_Time == 0) { tmrPlayer.Stop(); PlaySound.PlaySounds(Properties.Resources.TimesUp); MessageBox.Show(strTIMERS_UP, strTIMERS_UP, MessageBoxButtons.OK, MessageBoxIcon.Exclamation); btnShowAnswer.Focus(); } }
private void btnStart_Click(object sender, EventArgs e) { if (!(string.IsNullOrWhiteSpace(txtFirst.Text)) && !(string.IsNullOrWhiteSpace(txtSecond.Text))) { PlaySound.PlaySounds(Properties.Resources.Intro); teamOne = new Team(txtFirst.Text, 0); teamTwo = new Team(txtSecond.Text, 0); txtFirst.Clear(); txtSecond.Clear(); txtFirst.Focus(); btnStart.Enabled = false; FrmJeopardy = new FrmJeopardy(teamOne, teamTwo, strFileName); FrmJeopardy.Show(); this.Hide(); } else { MessageBox.Show(strINPUT_ERROR, strERROR, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void SetAnswer(object sender, EventArgs e) { int intPointValue = 0; int intWinners = 0; Team tempTeam; Button btnCurrent = (sender as Button); if ((string)btnCurrent.Tag == strADD) { intPointValue = FrmJeopardy.Teams[intCurrentTeam].intPoints + FrmJeopardy.intPointValue; PlaySound.PlaySounds(Properties.Resources.Correct); } else if ((string)btnCurrent.Tag == strSUBTRACT) { intPointValue = FrmJeopardy.Teams[intCurrentTeam].intPoints - FrmJeopardy.intPointValue; PlaySound.PlaySounds(Properties.Resources.Wrong); } tempTeam = new Team(FrmJeopardy.Teams[intCurrentTeam].strName, intPointValue); FrmJeopardy.Teams[intCurrentTeam] = tempTeam; (Application.OpenForms[strFRM_JEOPARDY] as FrmJeopardy).UpdateForm(); Close(); if (Application.OpenForms[strFRM_ANSWER] != null) { (Application.OpenForms[strFRM_ANSWER] as FrmAnswer).Close(); } if (GameIsOver()) { intWinners = (FrmJeopardy.Teams[0].intPoints > FrmJeopardy.Teams[1].intPoints ? 0 : 1); string strMessage = String.Format(strWINNING_TEAM, FrmJeopardy.Teams[intWinners].strName, FrmJeopardy.Teams[intWinners].intPoints); if (MessageBox.Show(strMessage, strWINNING_TITLE, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes) { (Application.OpenForms[strFRM_JEOPARDY] as FrmJeopardy).ResetForm(); } } }