Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. private void Form1_KeyDown(object sender, KeyEventArgs e)
  2. {
  3. // If the user pressed a key that's in the ListBox, remove it
  4. // and then make the game a little faster
  5. if (listBox1.Items.Contains(e.KeyCode))
  6. {
  7. listBox1.Items.Remove(e.KeyCode);
  8. listBox1.Refresh();
  9. if (timer1.Interval > 400)
  10. timer1.Interval -= 10;
  11. if (timer1.Interval > 250)
  12. timer1.Interval -= 7;
  13. if (timer1.Interval > 100)
  14. timer1.Interval -= 2;
  15. difficultyProgressBar.Value = 800 - timer1.Interval;
  16. // The user pressed a correct key, so update the Stats object
  17. // by calling its Update() method with the argument true
  18. stats.Update(true);
  19. }
  20. else
  21. {
  22. // The user pressed an incorrect key, so update the Stats object
  23. // by calling its Update() method with the argument false
  24. stats.Update(false);
  25. }
  26. // Update the labels on the StatusStrip
  27. correctLabel.Text = "Correct: " + stats.Correct;
  28. missedLabel.Text = "Missed: " + stats.Missed;
  29. totalLabel.Text = "Total: " + stats.Total;
  30. accuracyLabel.Text = "Accuracy: " + stats.Accuracy + "%";
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement