当前位置: 网学 > 编程文档 > VB > 正文

VB扫雷源代码

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 12/10/16
下载{$ArticleTitle}原创论文样式
p;     
           End If
       Next
   Next
  End If
End If
End Sub


Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single,
Y As Single)
If Button = vbLeftButton Then
   ''左击
   If What(mX + 1, mY + 1) = 10 Then
      ''点到雷
      Timer1.Enabled = False
      Picture1.PaintPicture image1(13).Picture, mX, mY
      Picture1.Enabled = False
      Label3 = "哇!你点到雷了呀!重来吧!!!"
      EndGame
      Timer1 = False
      Picture1.Enabled = False
      Exit Sub
   ElseIf What(mX + 1, mY + 1) >= 1 And What(mX + 1, mY + 1) <= 9 Then
      ''点到数字
      OpenFlag = OpenFlag + 1
      Picture1.PaintPicture image1(What(mX + 1, mY + 1)).Picture, mX, mY
      What(mX + 1, mY + 1) = -What(mX + 1, mY + 1)
   ElseIf What(mX + 1, mY + 1) = 0 Then
      ''点到空
      Picture1.PaintPicture image1(0).Picture, mX, mY
      What(mX + 1, mY + 1) = 11
      OpenBlank mX + 1, mY + 1
   End If
   If MineFlag + OpenFlag = NowHeight * NowWidth Then
      Label3 = "恭喜恭喜!你过关了!"
      Timer1.Enabled = False
      Picture1.Enabled = False
   End If
ElseIf Button = vbRightButton Then
   ''右击
   If What(mX + 1, mY + 1) >= 0 And What(mX + 1, mY + 1) <= 10 Then
      ''未标记过的进行标记
      Save(mX + 1, mY + 1) = What(mX + 1, mY + 1)
      What(mX + 1, mY + 1) = 13
      Picture1.PaintPicture image1(10).Picture, mX, mY
      MineFlag = MineFlag + 1
      Label1 = TotMine - MineFlag
   ElseIf What(mX + 1, mY + 1) = 13 Then
      ''已经标记过则改为?
      What(mX + 1, mY + 1) = 14
      MineFlag = MineFlag - 1
      Label1 = TotMine - MineFlag
      Picture1.PaintPicture image1(11).Picture, mX, mY
   ElseIf What(mX + 1, mY + 1) = 14 Then
      ''标记过?号的则
      What(mX + 1, mY + 1) = Save(mX + 1, mY + 1)
      Picture1.PaintPicture image1(9).Picture, mX, mY
   End If
End If
End Sub
Private Sub ClearStart(ByVal mWidth As Long, ByVal mHeight As Long, ByVal
MineNumber As Long)
''预置雷位置
Randomize
mTime

网学推荐

免费论文

原创论文

浏览:
设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
湘ICP备09003080号