怎么用VB做挖地雷游戏?

来源:百度知道 编辑:UC知道 时间:2024/05/13 17:06:52
我想知道制作方法和代码

用到的技术有以下几个:
1.动态图像切割
2.动态控件
3.算法

完整的代码我给你,能不能看明白就靠你自己了,我写程序从来不注释

Option Explicit
Dim h As Integer, w As Integer
Dim sizeofpicture As Integer
Dim bombnum As Integer
Dim bomb() As Integer
Dim view() As Integer
Dim onebuttonflag As Integer
Dim bactive As Boolean
Dim timeactive As Boolean
Dim oldx As Integer, oldy As Integer
Dim questres
Public Sub drawall()
Dim i As Integer, j As Integer
For i = 0 To w - 1
For j = 0 To h - 1
bm.PaintPicture bakimg, i, j, 1, 1, view(i, j), 0, 1, 1
Next j
Next i
bm.Line (0, 0)-(w + 0.05, 0)
bm.Line (w + 0.05, 0)-(w + 0.05, h + 0.05)
bm.Line (w + 0.05, h + 0.05)-(0, h + 0.05)
bm.Line (0, h + 0.05)-(0, 0)
End Sub

Public Sub complute()
bactive = False
timeactive = False
Time1s.Interval = 0

Dim i As Integer, j As Integer
For i = 0 To w - 1
For j = 0 To h - 1