我想编制匹配的纸牌游戏,第一级我们有4张照片,如果相同,则分数会增加,如果不是,它会再次关闭。
我使用button
和picturebox
(不可见),button click
picturebox
可见变为真,所以我必须点击两个buttons
来确定它们是否匹配或不同的是,在不同图像的情况下,第二张照片不会出现。我试着把延迟功能放在同样的情况下。
Dim P, Q, As Boolean
Dim X, Y, Z, W As Integer
Sub AA()
'if p false means no button clicked if q true two
'buttons clicked
If P = False Then
P = True
Else
Q = True
End If
If Q Then
If (X = 1 And Y = 1) Then
PictureBox11.Visible = True
PictureBox14.Visible = True
Button1.Visible = False
Button4.Visible = False
X = 0
Y = 0
ElseIf (Z = 1 And W = 1) Then
PictureBox12.Visible = True
PictureBox13.Visible = True
Button3.Visible = False
Button2.Visible = False
Z = 0
W = 0
Else
Z = 0
Y = 0
W = 0
X = 0
PictureBox11.Visible = False
PictureBox12.Visible = False
PictureBox13.Visible = False
PictureBox14.Visible = False
End If
P = False
Q = False
End If
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
PictureBox11.Visible = True
X = 1
Call AA()
end sub
'and the same for 4 buttons