-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm2.vb
More file actions
124 lines (106 loc) · 4.61 KB
/
Form2.vb
File metadata and controls
124 lines (106 loc) · 4.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
Public Class Form2
Dim change As Boolean = False ' Image should display
Dim happyCat As Image = My.Resources.Happy_Cat_X
Dim tiredCat As Image = My.Resources.Tired_Cat_O
Dim counter As Integer = 0
Dim counter2 As Integer = 0
Private Sub KittyTalk(sender As PictureBox, e As EventArgs) Handles PictureBox10.Click
MsgBox("Welcome to Tic Tac Toe!")
MsgBox("Press the boxes to start playing!")
MsgBox("GOOd Luck!")
End Sub
Private Sub PictureBox(sender As PictureBox, e As EventArgs) Handles PictureBox1.Click, PictureBox2.Click, PictureBox3.Click,
PictureBox4.Click, PictureBox5.Click, PictureBox6.Click, PictureBox7.Click, PictureBox8.Click, PictureBox9.Click
If change Then
sender.Image = happyCat
change = False
Else
sender.Image = tiredCat
change = True
End If
If PictureBox1.Image Is happyCat And PictureBox2.Image Is happyCat And PictureBox3.Image Is happyCat Then
counter = counter + 1
lblPlayer1Score.Text = counter
PictureBox1.Image = Nothing
PictureBox2.Image = Nothing
PictureBox3.Image = Nothing
End If
If PictureBox4.Image Is happyCat And PictureBox5.Image Is happyCat And PictureBox6.Image Is happyCat Then
counter = counter + 1
lblPlayer1Score.Text = counter
PictureBox4.Image = Nothing
PictureBox5.Image = Nothing
PictureBox6.Image = Nothing
End If
If PictureBox7.Image Is happyCat And PictureBox8.Image Is happyCat And PictureBox9.Image Is happyCat Then
counter = counter + 1
lblPlayer1Score.Text = counter
PictureBox7.Image = Nothing
PictureBox8.Image = Nothing
PictureBox9.Image = Nothing
End If
If PictureBox3.Image Is happyCat And PictureBox5.Image Is happyCat And PictureBox9.Image Is happyCat Then
counter = counter + 1
lblPlayer1Score.Text = counter
PictureBox3.Image = Nothing
PictureBox5.Image = Nothing
PictureBox9.Image = Nothing
End If
If PictureBox1.Image Is happyCat And PictureBox5.Image Is happyCat And PictureBox7.Image Is happyCat Then
counter = counter + 1
lblPlayer1Score.Text = counter
PictureBox1.Image = Nothing
PictureBox5.Image = Nothing
PictureBox7.Image = Nothing
End If
If PictureBox1.Image Is tiredCat And PictureBox2.Image Is tiredCat And PictureBox3.Image Is tiredCat Then
counter2 = counter2 + 1
lblPlayer2Score.Text = counter2
PictureBox1.Image = Nothing
PictureBox2.Image = Nothing
PictureBox3.Image = Nothing
End If
If PictureBox4.Image Is tiredCat And PictureBox5.Image Is tiredCat And PictureBox6.Image Is tiredCat Then
counter2 = counter2 + 1
lblPlayer2Score.Text = counter2
PictureBox4.Image = Nothing
PictureBox5.Image = Nothing
PictureBox6.Image = Nothing
End If
If PictureBox7.Image Is tiredCat And PictureBox8.Image Is tiredCat And PictureBox9.Image Is tiredCat Then
counter2 = counter2 + 1
lblPlayer2Score.Text = counter2
PictureBox7.Image = Nothing
PictureBox8.Image = Nothing
PictureBox9.Image = Nothing
End If
If PictureBox1.Image Is tiredCat And PictureBox5.Image Is tiredCat And PictureBox7.Image Is tiredCat Then
counter2 = counter2 + 1
lblPlayer2Score.Text = counter2
PictureBox1.Image = Nothing
PictureBox5.Image = Nothing
PictureBox7.Image = Nothing
End If
If PictureBox3.Image Is tiredCat And PictureBox5.Image Is tiredCat And PictureBox9.Image Is tiredCat Then
counter2 = counter2 + 1
lblPlayer2Score.Text = counter2
PictureBox3.Image = Nothing
PictureBox5.Image = Nothing
PictureBox9.Image = Nothing
End If
End Sub
Private Sub RESETBUTTON(sender As Object, e As EventArgs) Handles Button1.Click
lblPlayer1Score.Text = 0
lblPlayer2Score.Text = 0
End Sub
Private Sub ENDBUTTON(sender As Object, e As EventArgs) Handles Button2.Click
End
End Sub
Private Sub LEVEL2(sender As Object, e As EventArgs)
Me.Hide()
Form4.Show()
End Sub
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Me.CenterToScreen()
End Sub
End Class