Image1,Image2,Image3 分别是锤子的三种状态(取起,平放,砸下) Image4,Image5,Image6 分别是老鼠的状态(躲下,出来,晕) Dim 鼠X As Single Dim 鼠Y As Single Dim 地鼠 As Byte Dim 对数 As Integer Dim 总数 As Integer Sub 判断(X, Y) Select Case 地鼠 Case 0, 1, 2 X = 地鼠 Y = 0 Case 3, 4, 5 X = 地鼠 - 3 Y = 1 Case 6, 7, 8 X = 地鼠 - 6 Y = 2 End Select End Sub Private Sub Form_Load() Randomize Show Print For 地鼠 = 0 To 8 判断 X, Y Form1.PaintPicture Image5.Picture, 1000 + 1050 * X, 1000 + 1050 * Y Next 总数 = 1 End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image1.Move X - Image1.Width / 2, Y - Image1.Height / 2 鼠X = Image1.Left 鼠Y = ***.Top Timer1.Enabled = True Label2.Caption = "运行中..." End Sub Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Image1.Picture = Image3.Picture xy = 99 If 鼠X > 800 And 鼠X 1600 And 鼠Y + 1500 2650 And 鼠Y + 1500 3700 And 鼠Y + 1500 1850 And 鼠X 1600 And 鼠Y + 1500 2650 And 鼠Y + 1500 3700 And 鼠Y + 1500 2900 And 鼠X 1600 And 鼠Y + 1500 2650 And 鼠Y + 1500 3700 And 鼠Y + 1500 100 Then Timer1.Enabled = False 判断 X, Y Form1.PaintPicture Image5.Picture, 1000 + 1050 * X, 1000 + 1050 * Y If 对数 > 100 Then msg = MsgBox("恭喜" + Chr(13) + "你以经爆机了,还要继续吗?", vbYesNo, "地鼠娱乐部") Else msg = MsgBox("你以经过关了,您打中了" & 对数 & "次。还要继续吗?", vbYesNo, "地鼠娱乐部") End If If msg = vbYes Then 总数 = 1 对数 = 0 Timer1.Enabled = True Else Unload Me End If End If End Sub