⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 连连看.frm

📁 用VB写的连连看游戏
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   0  'None
   Caption         =   "连连看"
   ClientHeight    =   8550
   ClientLeft      =   2205
   ClientTop       =   1515
   ClientWidth     =   10395
   Icon            =   "连连看.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MousePointer    =   99  'Custom
   Picture         =   "连连看.frx":1082
   ScaleHeight     =   570
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   693
   ShowInTaskbar   =   0   'False
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Interval        =   2500
      Left            =   1320
      Top             =   8490
   End
   Begin VB.PictureBox Picture2 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      AutoSize        =   -1  'True
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   7950
      Left            =   285
      Picture         =   "连连看.frx":27896
      ScaleHeight     =   7950
      ScaleWidth      =   9750
      TabIndex        =   0
      Top             =   330
      Width           =   9750
      Begin VB.PictureBox Picture5 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   300
         Left            =   1110
         MouseIcon       =   "连连看.frx":2F7D3
         MousePointer    =   99  'Custom
         Picture         =   "连连看.frx":2F925
         ScaleHeight     =   300
         ScaleWidth      =   600
         TabIndex        =   4
         Top             =   345
         Width           =   600
      End
      Begin VB.PictureBox Picture4 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         AutoSize        =   -1  'True
         BackColor       =   &H80000005&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   300
         Left            =   270
         MouseIcon       =   "连连看.frx":330F6
         MousePointer    =   99  'Custom
         Picture         =   "连连看.frx":33248
         ScaleHeight     =   300
         ScaleWidth      =   600
         TabIndex        =   3
         Top             =   330
         Width           =   600
      End
      Begin VB.PictureBox Picture3 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         BackColor       =   &H00404040&
         BorderStyle     =   0  'None
         ForeColor       =   &H80000008&
         Height          =   150
         Left            =   1950
         ScaleHeight     =   10
         ScaleMode       =   3  'Pixel
         ScaleWidth      =   450
         TabIndex        =   2
         Top             =   570
         Width           =   6750
      End
      Begin VB.PictureBox Picture1 
         Appearance      =   0  'Flat
         AutoRedraw      =   -1  'True
         BackColor       =   &H00000000&
         BorderStyle     =   0  'None
         ForeColor       =   &H00000000&
         Height          =   7200
         Left            =   75
         MouseIcon       =   "连连看.frx":36B3A
         ScaleHeight     =   480
         ScaleMode       =   3  'Pixel
         ScaleWidth      =   640
         TabIndex        =   1
         Top             =   690
         Width           =   9600
      End
      Begin VB.Label Label4 
         Alignment       =   2  'Center
         AutoSize        =   -1  'True
         BackColor       =   &H00000000&
         Caption         =   "进入下一关"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15.75
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000FF&
         Height          =   315
         Left            =   4290
         MouseIcon       =   "连连看.frx":36C8C
         MousePointer    =   99  'Custom
         TabIndex        =   8
         Top             =   180
         Width           =   1665
      End
      Begin VB.Label Label3 
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00000000&
         Caption         =   "1"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000C0&
         Height          =   315
         Left            =   2355
         TabIndex        =   7
         Top             =   195
         Width           =   180
      End
      Begin VB.Label Label2 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00000000&
         Caption         =   "关"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000C0&
         Height          =   315
         Left            =   2640
         TabIndex        =   6
         Top             =   195
         Width           =   345
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00000000&
         Caption         =   "第"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   15.75
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H000000C0&
         Height          =   315
         Left            =   1905
         TabIndex        =   5
         Top             =   180
         Width           =   345
      End
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   200
      Left            =   615
      Top             =   8505
   End
   Begin VB.Menu yx 
      Caption         =   "游戏(&F)"
      Begin VB.Menu again 
         Caption         =   "开始(&R)"
         Shortcut        =   {F5}
      End
      Begin VB.Menu stop 
         Caption         =   "暂停(&S)"
         Shortcut        =   {F6}
      End
      Begin VB.Menu xian 
         Caption         =   "-"
      End
      Begin VB.Menu over 
         Caption         =   "退出(&X)"
         Shortcut        =   {F7}
      End
   End
   Begin VB.Menu bazhu 
      Caption         =   "帮助(&H)"
      Begin VB.Menu about 
         Caption         =   "关于(&A)"
         Shortcut        =   {F1}
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub about_Click()
    Form3.Show
End Sub

Private Sub again_Click()
    Call initgraph
End Sub

Private Sub Command1_Click()

End Sub

Private Sub Form_Load()
    Form1.Top = (Screen.Height - Form1.Height) / 2
    Form1.Left = (Screen.Width - Form1.Width) / 2
    Form1.Picture3.PaintPicture Form2.Picture4.Picture, 0, 0, 450, 10, , , , , vbSrcCopy
    stack_n = 1              '初始化栈的处位置
    mousedo.flag = 0         '初始化鼠标的操作0:表示没有点击
    mousedo.x1 = 2: mousedo.y1 = 2
    alrealy = False: can1 = True: stopflag = False
    passn = 1                '进入关数为一
    Label4.Visible = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
    End
End Sub

Private Sub Label4_Click()
    Call initgraph
End Sub

Private Sub over_Click()
    End
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If (Y \ 40 + 1 >= 2 And Y \ 40 + 1 <= 11) And (X \ 40 + 1 >= 2 And X \ 40 + 1 <= 15) Then
        If jl(Y \ 40 + 1, X \ 40 + 1).flag = 0 Then Exit Sub    '如果点击位置没有图片不处理
        If playflag = False Or stopflag = True Or overflag = True Then Exit Sub    '如果没有进行游戏或者是暂停游戏或是结束游戏屏蔽点击功能
        mousedo.x2 = mousedo.x1    '记录点击图块x坐标
        mousedo.y2 = mousedo.y1    '记录点击图块的Y坐标
        mousedo.y1 = X \ 40 + 1    '更新上一次的点击位置
        mousedo.x1 = Y \ 40 + 1    '更新上一次的点击位置
        Call mousehit
    End If
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If X \ 40 + 1 >= 2 And X \ 40 <= 15 And Y \ 40 + 1 >= 2 And Y \ 40 + 1 <= 11 Then
        If jl(Y \ 40 + 1, X \ 40 + 1).flag = 1 Then Picture1.MousePointer = 99
    Else
        Picture1.MousePointer = 0
    End If
End Sub
Private Sub Picture4_Click()
    Call help
End Sub

Private Sub Picture5_Click()
    Call hitsound
    Call space
End Sub

Private Sub stop_Click()
    Call space
End Sub

Private Sub Timer1_Timer()
    time1 = time1 + 1
End Sub

Private Sub Timer2_Timer()
    Call gametimer           '游戏记时
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -