?? mine.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "掃雷"
ClientHeight = 4245
ClientLeft = 4230
ClientTop = 3555
ClientWidth = 6990
LinkTopic = "Form1"
ScaleHeight = 4245
ScaleWidth = 6990
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 3720
Top = 240
End
Begin VB.CommandButton Command1
Caption = "開始游戲"
Height = 495
Left = 480
TabIndex = 1
Top = 120
Width = 1215
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
Enabled = 0 'False
Height = 3375
Left = 120
ScaleHeight = 3315
ScaleWidth = 6315
TabIndex = 0
Top = 720
Width = 6375
End
Begin VB.Image Image1
Height = 240
Index = 14
Left = 6600
Picture = "mine.frx":0000
Top = 3960
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 13
Left = 6600
Picture = "mine.frx":200E
Top = 3720
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 12
Left = 6600
Picture = "mine.frx":41BA
Top = 3480
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 11
Left = 6600
Picture = "mine.frx":61C8
Top = 3240
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 10
Left = 6600
Picture = "mine.frx":8308
Top = 3000
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 9
Left = 6600
Picture = "mine.frx":A462
Top = 2760
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 8
Left = 6600
Picture = "mine.frx":C4D8
Top = 2520
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 7
Left = 6600
Picture = "mine.frx":E6A6
Top = 2280
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 6
Left = 6600
Picture = "mine.frx":10826
Top = 2040
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 5
Left = 6600
Picture = "mine.frx":129CE
Top = 1800
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 4
Left = 6600
Picture = "mine.frx":14B7E
Top = 1560
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 3
Left = 6600
Picture = "mine.frx":16D20
Top = 1320
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 2
Left = 6600
Picture = "mine.frx":18ED2
Top = 1080
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 1
Left = 6600
Picture = "mine.frx":1B078
Top = 840
Visible = 0 'False
Width = 240
End
Begin VB.Image Image1
Height = 240
Index = 0
Left = 6600
Picture = "mine.frx":1D203
Top = 600
Visible = 0 'False
Width = 240
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "加油,祝你好運!"
Height = 180
Left = 2160
TabIndex = 4
Top = 270
Width = 1350
End
Begin VB.Label Label2
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
ForeColor = &H000000FF&
Height = 375
Left = 6000
TabIndex = 3
Top = 180
Width = 855
End
Begin VB.Label Label1
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Height = 375
Left = 5520
TabIndex = 2
Top = 180
Width = 375
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'標志說明
' 0 ~ 9 未打開的
' -1 ~ -9 已打開的
' 10 雷
' 11 已打開的空(未判斷)
' 12 已打開的空(已判斷)
' 13 標記過的
' 14 問號
'
Dim What(1 To 30, 1 To 16) As Long '點
Dim Save(1 To 30, 1 To 16) As Long '存
Dim mX As Long
Dim mY As Long '坐標
Dim mTime As Long
Dim MineFlag As Long '標記雷
Dim OpenFlag As Long '已打開的
Dim NowWidth As Long
Dim NowHeight As Long
Dim TotMine As Long '總雷數(shù)
Private Sub Command1_Click()
Timer1.Enabled = True
Picture1.Enabled = True
Label2 = "00:00"
Label1 = TotMine
Label3 = "加油哦,祝你好運!!!"
Picture1.Enabled = True
For X = 0 To NowWidth - 1
For Y = 0 To NowHeight - 1
Picture1.PaintPicture Image1(9).Picture, X, Y
Next
Next
ClearStart NowWidth, NowHeight, TotMine
WriteNumber NowWidth, NowHeight
End Sub
Private Sub Form_Load()
Dim X As Long
Dim Y As Long
Show
NowHeight = 16
NowWidth = 30
TotMine = 40
Picture1.Height = (Image1(0).Height) * NowHeight
Picture1.Width = (Image1(0).Width) * NowWidth
Form1.Height = Picture1.Height + 1250
Form1.Width = Picture1.Width + 400
Picture1.ScaleMode = 3
Picture1.ScaleHeight = NowHeight
Picture1.ScaleWidth = NowWidth
For X = 0 To NowWidth - 1
For Y = 0 To NowHeight - 1
Picture1.PaintPicture Image1(9).Picture, X, Y
Next
Next
ClearStart NowWidth, NowHeight, TotMine
WriteNumber NowWidth, NowHeight
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
Dim T As Long
Dim X1 As Long
Dim Y1 As Long
Dim x2 As Single
Dim y2 As Single
mX = Int(X)
mY = Int(Y)
If Button = vbLeftButton Then
'左鍵按下
If What(mX + 1, mY + 1) >= 0 And What(mX + 1, mY + 1) <= 10 Then
Picture1.PaintPicture Image1(14).Picture, mX, mY
End If
ElseIf Button = vbRightButton Then
'右鍵按下
'只有是打開的才處理
If What(mX + 1, mY + 1) >= -9 And What(mX + 1, mY + 1) <= -1 Then
T = 0
'計算標記的雷
For X1 = mX To mX + 2
For Y1 = mY To mY + 2
If X1 = mX + 1 And Y1 = mY + 1 Then
Else
If X1 >= 1 And X1 <= NowWidth Then
If Y1 >= 1 And Y1 <= NowHeight Then
If What(X1, Y1) = 13 Then
T = T + 1
End If
End If
End If
End If
Next
Next
'如果標記數(shù)大于等于雷數(shù)則不處理
If T >= -(What(mX + 1, mY + 1)) Then Exit Sub
'如果標記數(shù)等于雷數(shù)則打開
If T = -What(mX + 1, mY + 1) Then
For X1 = mX To mX + 2
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -