Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11.  
  12. namespace Assignment_1._0
  13. {
  14.  
  15. public partial class Form1 : Form
  16. {
  17. int credits = 0;
  18. bool playing = false;
  19.  
  20. public Form1()
  21. {
  22. InitializeComponent();
  23. buttonPlay.Visible = false;
  24. if (credits > 0)
  25. {
  26. buttonPlay.Visible = true;
  27. }
  28. }
  29.  
  30.  
  31. private void button6_Click(object sender, EventArgs e)
  32. {
  33. credits += 5;
  34. lblCredits.Text = Convert.ToString(credits);
  35.  
  36. }
  37.  
  38. private void lblCredits_Click(object sender, EventArgs e)
  39. {
  40.  
  41. }
  42.  
  43. private void buttonPlay_Click(object sender, EventArgs e)
  44. {
  45. playing = true;
  46. if (credits <= 0)
  47. {
  48. playing = false;
  49. }
  50. }
  51.  
  52. private void buttonTest_Click(object sender, EventArgs e)
  53. {
  54. credits -= 1;
  55. }
  56.  
  57.  
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement