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

📄 ernos.frm

📁 用vb编的游戏!
💻 FRM
📖 第 1 页 / 共 3 页
字号:
         Next i
         For i = 80 To 179 Step 11
          Image1(i).Visible = False
         Next i
         For i = 80 To 179 Step 9
          Image1(i).Visible = False
         Next i
     
     Case 3
         For i = 80 To 179 Step 11
          Call tt(i)
         Next i
         For i = 80 To 179 Step 9
          Call tt(i)
         Next i
     
     Case 4
         For i = 84 To 120 Step 9
           Call tt(i)
         Next i
         For i = 85 To 129 Step 11
          Call tt(i)
         Next i
         For i = 130 To 174 Step 11
          Call tt(i)
         Next i
         For i = 139 To 175 Step 9
          Call tt(i)
         Next i
         
    Case 5
        For i = 80 To 179
           Call tt(i)
        Next i
        For i = 84 To 120 Step 9
          Image1(i).Visible = False
         Next i
         For i = 85 To 129 Step 11
          Image1(i).Visible = False
         Next i
         For i = 130 To 174 Step 11
          Image1(i).Visible = False
         Next i
         For i = 139 To 175 Step 9
          Image1(i).Visible = False
         Next i
    
    Case 6
        For i = 80 To 89
          Call tt(i)
        Next i
        For i = 120 To 129
         Call tt(i)
        Next i
        For i = 170 To 179
         Call tt(i)
        Next i
        For i = 82 To 177 Step 5
         If Image1(i).Visible = False Then
           Call tt(i)
           Else
            Image1(i).Visible = False
         End If
        Next i
    
    Case 7
       
        For i = 1 To 3
         For j = 0 To 2
          Call tt((9 + j) * 10 + i)
         Next j
         For j = 0 To 2
          Call tt((9 + j) * 10 + i + 5)
         Next j
         For j = 0 To 2
          Call tt((14 + j) * 10 + i)
         Next j
         For j = 0 To 2
          Call tt((14 + j) * 10 + i + 5)
         Next j
        Next i
      
      Image1(102).Visible = False
      Image1(107).Visible = False
      Image1(152).Visible = False
      Image1(157).Visible = False
      
   Case 8
     For i = 1 To 3
         For j = 0 To 2
          Call tt((9 + j) * 10 + i)
         Next j
         For j = 0 To 2
          Call tt((9 + j) * 10 + i + 5)
         Next j
         For j = 0 To 2
          Call tt((14 + j) * 10 + i)
         Next j
         For j = 0 To 2
          Call tt((14 + j) * 10 + i + 5)
         Next j
     Next i
     
     For i = 80 To 179
      If Image1(i).Visible = True Then
          Image1(i).Visible = False
          Else
          Call tt(i)
       End If
     Next i
      
      Image1(102).Visible = True
      Image1(107).Visible = True
      Image1(152).Visible = True
      Image1(157).Visible = True
      
      For i = 4 To 5
       Image1(80 + i).Visible = False
       Image1(120 + i).Visible = False
       Image1(130 + i).Visible = False
       Image1(170 + i).Visible = False
     Next i
   
   
   Case 9
    For i = 80 To 89 Step 2
      Call tt(i)
     Next i
    For i = 90 To 179
     If Image1(i - 10).Visible = False Then Call tt(i)
     Next i
   
   Case 10
        For i = 80 To 179
           j = Int(2 * Rnd)
           If j = 1 Then Call tt(i)
        Next i
  End Select
  
End If
 
 Timer1.Interval = 440 - gk * 40
 score = 0
 Label1.Caption = 0
 score1 = 0
 Timer1.Enabled = True
  p = 1

 



 cta = Int(7 * Rnd)
 ctb = Int(4 * Rnd)
 czb = first(cta, ctb)
 cco = Int(7 * Rnd)
 Call view(cta, ctb, czb, 1)
 Call viewb
 
 
End Sub


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)    '响应键盘
 If KeyCode = 80 Then                  'pause
  If p = 1 Then
     Image11(2).Visible = True
     Timer1.Enabled = False
     p = 0
    Else
     Image11(2).Visible = False
     Timer1.Enabled = True
     p = 1
    End If
 End If
 

   
  
If KeyCode = 83 Then Call start       'start



If p = 1 Then
    If KeyCode = 37 Then Call leftmove
    If KeyCode = 38 Then Call fly1
    If KeyCode = 39 Then Call rightmove
    If KeyCode = 40 Then Call downmove
End If
End Sub



Private Sub Form_Load()   ' 进入游戏

For i = 1 To 179
 Load Image1(i)
Next i
For i = 1 To 15
Load Image3(i)
Next i
For i = 0 To 17
  For j = 0 To 9
  Image1(i * 10 + j).Top = i * 20 + 117
  Image1(i * 10 + j).Left = j * 20 + 59
  Image1(i * 10 + j).Visible = False
  Next j
Next i

 For i = 0 To 3
  For j = 0 To 3
  
  Image3(i * 4 + j).Top = i * 20 + 117
  Image3(i * 4 + j).Left = j * 20 + 350

  Image3(i).Visible = False
  Next j
 Next i               '定位
 
 pause = False
 gk = 1
 tgk = 1
 Label2.Caption = 1
 t = 0
 ii = 1
 
 mciExecute "open """ & App.Path & "\music.mid"""
 mciExecute "play """ & App.Path & "\music.mid"""
 musici = 0
 musickey = True
End Sub
Sub make(m, n, X, Y, z)         '  生成小方块   ok!
 
  
  If z = 1 Then
  Image1(m).Picture = Image2(cco).Picture
  Image1(n).Picture = Image2(cco).Picture
  Image1(X).Picture = Image2(cco).Picture
  Image1(Y).Picture = Image2(cco).Picture
  
  Image1(m).Visible = True
  Image1(n).Visible = True
  Image1(X).Visible = True
  Image1(Y).Visible = True
  Else
  Image3(m).Picture = Image2(bco).Picture
  Image3(n).Picture = Image2(bco).Picture
  Image3(X).Picture = Image2(bco).Picture
  Image3(Y).Picture = Image2(bco).Picture
  
  Image3(m).Visible = True
  Image3(n).Visible = True
  Image3(X).Visible = True
  Image3(Y).Visible = True
  End If
  End Sub
 Sub unmake(m, n, X, Y, z) ' 消除小方块    ok!
 If z = 1 Then
  Image1(m).Visible = False
 Image1(n).Visible = False
 Image1(X).Visible = False
 Image1(Y).Visible = False
 Else
 Image3(m).Visible = False
 Image3(n).Visible = False
 Image3(X).Visible = False
 Image3(Y).Visible = False
 End If
 End Sub
Sub view(ta, tb, zb, z)      '显示方块          ok!
 Dim e1, e2 As Integer
 e1 = zb Mod 10
 e2 = Int(zb / 10)
 b = 0
Select Case ta
Case 0
  Select Case tb
    Case 0, 2
     If e1 < 1 Or e1 > 7 Then Exit Sub
     If e2 < 0 Or e2 > 17 Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 2).Visible = True Then Exit Sub
     b = 1
     Call make(zb - 1, zb, zb + 1, zb + 2, z)
    Case 1, 3
     If e1 < 0 Or e1 > 9 Then Exit Sub
     If e2 < 1 Or e2 > 15 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     If Image1(zb + 20).Visible = True Then Exit Sub
     b = 1
     Call make(zb - 10, zb, zb + 10, zb + 20, z)
     End Select
Case 1
  Select Case tb
    Case 0
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 0 Or e2 > 16 Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 9).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 1, zb, zb + 1, zb + 9, z)
    Case 1
     If e1 < 1 Or e1 > 9 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 11).Visible = True Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 11, zb - 10, zb, zb + 10, z)
    Case 2
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 1 Or e2 > 17 Then Exit Sub
     If Image1(zb - 9).Visible = True Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 9, zb - 1, zb, zb + 1, z)
    Case 3
     If e1 < 0 Or e1 > 8 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     If Image1(zb + 11).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb, zb + 10, zb + 11, z)
      End Select
Case 2
  Select Case tb
    Case 0
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 0 Or e2 > 16 Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 11).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 1, zb, zb + 1, zb + 11, z)
    Case 1
     If e1 < 1 Or e1 > 9 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 9).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb, zb + 9, zb + 10, z)
    Case 2
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 1 Or e2 > 17 Then Exit Sub
     If Image1(zb - 11).Visible = True Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 11, zb - 1, zb, zb + 1, z)
    Case 3
     If e1 < 0 Or e1 > 8 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb - 9).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb - 9, zb, zb + 10, z)
      End Select
Case 3
  Select Case tb
    Case 0, 2
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 0 Or e2 > 16 Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     If Image1(zb + 11).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 1, zb, zb + 10, zb + 11, z)
    Case 1, 3
     If e1 < 1 Or e1 > 9 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 9).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb - 1, zb, zb + 9, z)
      End Select
Case 4
  Select Case tb
     Case 0, 2
      If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 0 Or e2 > 16 Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 9).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb, zb + 1, zb + 9, zb + 10, z)
    Case 1, 3
     If e1 < 1 Or e1 > 9 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 11).Visible = True Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 11, zb - 1, zb, zb + 10, z)
      End Select
Case 5
  Select Case tb
    Case 0
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 0 Or e2 > 16 Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 1, zb, zb + 1, zb + 10, z)
    Case 1
     If e1 < 1 Or e1 > 9 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb - 1, zb, zb + 10, z)
    Case 2
     If e1 < 1 Or e1 > 8 Then Exit Sub
     If e2 < 1 Or e2 > 17 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb - 1).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb - 1, zb, zb + 1, z)
    Case 3
     If e1 < 0 Or e1 > 8 Then Exit Sub
     If e2 < 1 Or e2 > 16 Then Exit Sub
     If Image1(zb - 10).Visible = True Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     b = 1
      Call make(zb - 10, zb, zb + 1, zb + 10, z)
      End Select
Case 6
     If e1 < 0 Or e1 > 8 Then Exit Sub
     If e2 < 0 Or e2 > 16 Then Exit Sub
     If Image1(zb).Visible = True Then Exit Sub
     If Image1(zb + 1).Visible = True Then Exit Sub
     If Image1(zb + 10).Visible = True Then Exit Sub
     If Image1(zb + 11).Visible = True Then Exit Sub
     b = 1

⌨️ 快捷键说明

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