打地鼠是一款使用VB.NET编写的休闲益智小游戏。玩家需快速点击钻出地面的地鼠图标,考验反应速度与手眼协调能力,适合各年龄段人群娱乐放松。
用VB.NET制作的小游戏——打地鼠
```vb.net
Public Class Form1
Inherits System.Windows.Forms.Form
Dim pic As New PictureBox
Dim goal As Integer
Dim i As Integer
Dim j As Integer
Dim xx1() As Integer = {135, 277, 417}
Dim xx2() As Integer = {157, 367}
Dim xx3() As Integer = {32, 251, 482}
Dim timer As Double = 1
Dim count As Integer 计时器跳动次数
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = 小游戏
Me.Size = New Size(650, 465)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 600
Timer1.Enabled = True
Button2.Visible = True
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Button2.Text = 暂停 Then
Button2.Text = 继续
Timer1.Enabled = False
PictureBox1.Enabled = False
ElseIf Button2.Text = 继续 Then
Button2.Text = 暂停
Timer1.Enabled = True
PictureBox1.Enabled = True
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Close()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ifclick = False
PictureBox1.Enabled = True
If timer = 0 Then
Timer1.Enabled = False
MsgBox(游戏结束,您的得分: + goal.ToString)
Button3.Visible = False
Exit Sub
End If
addpic()
timer -= count * 0.5 更新计时器值
End Sub
End Class
```