#2
wp2319572023-05-11 10:35
|
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录
Private Sub Workbook_Open()
Sheet1.Clear
Application.OnKey "{up}", "sheet1.UP"
Application.OnKey "{down}", "sheet1.DOWN"
Application.OnKey "{right}", "sheet1.RIGHT"
Application.OnKey "{left}", "sheet1.LEFT"
Range("A1").Select
End Sub
Sub main()
Dim Yanse As Integer
Cells(4, 5).Resize(20, 10).Interior.ColorIndex = 2
Cells(2, 9) = 0
Speed = 500
100:
No = Int(Rnd * 7) + 1
Zt = Int(Rnd * 4) + 1
Yanse = Int(Rnd * 7) + 1
Select Case Yanse
Case Is = 1
Color = 33
Case Is = 2
Color = 44
Case Is = 3
Color = 10
Case Is = 4
Color = 46
Case Is = 5
Color = 41
Case Is = 6
Color = 43
Case Is = 7
Color = 26
End Select
X = 4
Select Case No
Case Is = 1
Y = Int(Rnd * 10) + 5
Case Is < 4
Y = Int(Rnd * 9) + 5
Case Is < 7
Y = Int(Rnd * 8) + 5
End Select
Tetris CInt(No), CInt(Zt), CInt(Color), CInt(X), CInt(Y)
Hx = Minh(CInt(No), CInt(Zt), CInt(X), CInt(Y))
Do While Hx > 0
Application.ScreenUpdating = False
Tetris CInt(No), CInt(Zt), 2, CInt(X), CInt(Y)
X = X + 1
Tetris CInt(No), CInt(Zt), CInt(Color), CInt(X), CInt(Y)
Hx = Minh(CInt(No), CInt(Zt), CInt(X), CInt(Y))
Application.ScreenUpdating = True
Sleep Speed
DoEvents
Loop
kill
For j = 5 To 14
If Cells(7, j).Interior.ColorIndex <> 2 Then
MsgBox "GAME OVER!!": Score = Cells(2, 9): tiaozhanbang
Exit Sub
End If
Next
GoTo 100
200:
End Sub