Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void Form1_KeyDown(object sender, KeyEventArgs e)
- {
- // If the user pressed a key that's in the ListBox, remove it
- // and then make the game a little faster
- if (listBox1.Items.Contains(e.KeyCode))
- {
- listBox1.Items.Remove(e.KeyCode);
- listBox1.Refresh();
- if (timer1.Interval > 400)
- timer1.Interval -= 10;
- if (timer1.Interval > 250)
- timer1.Interval -= 7;
- if (timer1.Interval > 100)
- timer1.Interval -= 2;
- difficultyProgressBar.Value = 800 - timer1.Interval;
- // The user pressed a correct key, so update the Stats object
- // by calling its Update() method with the argument true
- stats.Update(true);
- }
- else
- {
- // The user pressed an incorrect key, so update the Stats object
- // by calling its Update() method with the argument false
- stats.Update(false);
- }
- // Update the labels on the StatusStrip
- correctLabel.Text = "Correct: " + stats.Correct;
- missedLabel.Text = "Missed: " + stats.Missed;
- totalLabel.Text = "Total: " + stats.Total;
- accuracyLabel.Text = "Accuracy: " + stats.Accuracy + "%";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement