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

📄 game.frm

📁 本人收藏的用VB编写的游戏程序,希望对大家有帮助,
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Begin VB.Form Game 
   AutoRedraw      =   -1  'True
   BackColor       =   &H0080FFFF&
   BorderStyle     =   0  'None
   Caption         =   "井字小游戏"
   ClientHeight    =   3270
   ClientLeft      =   2775
   ClientTop       =   2175
   ClientWidth     =   4485
   Icon            =   "Game.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3270
   ScaleWidth      =   4485
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton Command1 
      Appearance      =   0  'Flat
      BackColor       =   &H0080FFFF&
      DisabledPicture =   "Game.frx":27A2
      Height          =   350
      Left            =   3230
      Picture         =   "Game.frx":2DB9
      Style           =   1  'Graphical
      TabIndex        =   12
      ToolTipText     =   "开始游戏"
      Top             =   1080
      Width           =   730
   End
   Begin VB.CommandButton Command2 
      Appearance      =   0  'Flat
      BackColor       =   &H0080FFFF&
      CausesValidation=   0   'False
      Height          =   360
      Left            =   3230
      Picture         =   "Game.frx":33D0
      Style           =   1  'Graphical
      TabIndex        =   11
      ToolTipText     =   "退出程序"
      Top             =   1800
      Width           =   730
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   8
      Left            =   2460
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   8
      Top             =   2160
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   7
      Left            =   1800
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   7
      Top             =   2160
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   6
      Left            =   1140
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   6
      Top             =   2160
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   5
      Left            =   2460
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   5
      Top             =   1500
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   4
      Left            =   1800
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   4
      Top             =   1500
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   3
      Left            =   1140
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   3
      Top             =   1500
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   2
      Left            =   2460
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   2
      Top             =   840
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   1
      Left            =   1800
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   1
      Top             =   840
      Width           =   650
   End
   Begin VB.PictureBox Picture1 
      AutoRedraw      =   -1  'True
      BackColor       =   &H00C000C0&
      DrawWidth       =   10
      Height          =   650
      Index           =   0
      Left            =   1140
      ScaleHeight     =   585
      ScaleWidth      =   585
      TabIndex        =   0
      Top             =   840
      Width           =   650
      Begin VB.Shape Shape4 
         BackColor       =   &H0080FFFF&
         BorderColor     =   &H00808080&
         BorderWidth     =   2
         Height          =   3150
         Left            =   60
         Shape           =   2  'Oval
         Top             =   0
         Width           =   4350
      End
   End
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Interval        =   250
      Left            =   3840
      Top             =   0
   End
   Begin VB.Timer Timer1 
      Interval        =   20
      Left            =   3840
      Top             =   0
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "胜负"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF00FF&
      Height          =   375
      Left            =   1560
      TabIndex        =   10
      Top             =   360
      Width           =   1455
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "先手"
      BeginProperty Font 
         Name            =   "楷体_GB2312"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0080FFFF&
      Height          =   1485
      Left            =   600
      TabIndex        =   9
      Top             =   960
      Width           =   315
   End
   Begin VB.Image Image4 
      Height          =   3505
      Left            =   -150
      Picture         =   "Game.frx":3840
      Stretch         =   -1  'True
      Top             =   -105
      Width           =   4780
   End
End
Attribute VB_Name = "Game"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim total_count As Byte
Dim allow_select As Boolean
Dim x_pos As Single, y_pos As Single
Dim x_form As Single, x_to As Single
Dim num As Byte, who_num As Byte
Dim someone_win As Boolean
Dim line1 As Byte, line2 As Byte, line3 As Byte
'Dim AniIcon As Integer '动态图标
'Dim PerAniIcon As Long

Sub draw_ox(a)
 
  If total_count Mod 2 <> 0 Then '奇数时画出O形
    x_pos = 0.5 * Picture1(a).ScaleWidth
    y_pos = 0.5 * Picture1(a).ScaleHeight
    rad = 0.5 * Picture1(a).ScaleWidth - 100
    Picture1(a).Circle (x_pos, y_pos), rad, vbWhite
    Picture1(a).Tag = 1
  Else '偶数时画出X形
    x_form = 100
    x_to = Picture1(a).ScaleWidth - 100
    Picture1(a).Line (x_from, x_from)-(x_to, x_to), vbBlack
    Picture1(a).Line (x_from, x_to)-(x_to, x_from), vbBlack
    Picture1(a).Tag = -1
  End If
  check_win '检查是否边成一线

⌨️ 快捷键说明

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