Dim X As Integer
If num((cmd1(i).Width + cmd1(i).Left) / cmd1(i).Width, (cmd1(i).Top + cmd1(i).Height) / cmd1(i).Height + 1) = 0 And num((cmd2(i).Width + cmd2(i).Left) / cmd2(i).Width, (cmd2(i).Top + cmd2(i).Height) / cmd2(i).Height + 1) = 0 And num((cmd3(i).Width + cmd3(i).Left) / cmd3(i).Width, (cmd3(i).Top + cmd3(i).Height) / cmd3(i).Height + 1) = 0 And num((cmd4(i).Width + cmd4(i).Left) / cmd4(i).Width, (cmd4(i).Top + cmd4(i).Height) / cmd4(i).Height + 1) = 0 Then
cmd1(i).Top = cmd1(i).Top + cmd1(i).Height
cmd2(i).Top = cmd2(i).Top + cmd2(i).Height
cmd3(i).Top = cmd3(i).Top + cmd3(i).Height '若各个方块下面位置的值为0则可以下落,否则运行‘ELSE’
cmd4(i).Top = cmd4(i).Top + cmd4(i).Height
Else
Timer1.Interval = 1000 - 100 * Val(Label6.Caption)
For X = 1 To 10 '检测第一行的值,如果为任意一个值不为0,则运行提示,并退出
If num(X, 2) <> 0 Then
MsgBox "你的得分是:" & Str(fenshu)
End
End If
Next X
num((cmd1(i).Left + cmd1(i).Width) / cmd1(i).Width, (cmd1(i).Top + cmd1(i).Height) / cmd1(i).Height) = i + 1 '将刚才落下方块的位置记录为非0数字
num((cmd2(i).Left + cmd2(i).Width) / cmd2(i).Width, (cmd2(i).Top + cmd2(i).Height) / cmd2(i).Height) = i + 1
num((cmd3(i).Left + cmd3(i).Width) / cmd3(i).Width, (cmd3(i).Top + cmd3(i).Height) / cmd3(i).Height) = i + 1
num((cmd4(i).Left + cmd4(i).Width) / cmd4(i).Width, (cmd4(i).Top + cmd4(i).Height) / cmd4(i).Height) = i + 1
Set fangkuai((cmd1(i).Left + cmd1(i).Width) / cmd1(i).Width, (cmd1(i).Top + cmd1(i).Height) / cmd1(i).Height) = cmd1(i) '将落下的方块记录其对象名字
|