?? game.frm
字號:
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 + -