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

📄 frmmain.frm

📁 Bomberman Game using VB6
💻 FRM
📖 第 1 页 / 共 5 页
字号:
      Picture         =   "frmMain.frx":12E384
      Stretch         =   -1  'True
      Top             =   3240
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   12
      Left            =   1080
      Picture         =   "frmMain.frx":12FCEE
      Stretch         =   -1  'True
      Top             =   1080
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   11
      Left            =   2520
      Picture         =   "frmMain.frx":131658
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   10
      Left            =   7920
      Picture         =   "frmMain.frx":132FC2
      Stretch         =   -1  'True
      Top             =   3600
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   9
      Left            =   7920
      Picture         =   "frmMain.frx":13492C
      Stretch         =   -1  'True
      Top             =   2520
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   8
      Left            =   8280
      Picture         =   "frmMain.frx":136296
      Stretch         =   -1  'True
      Top             =   2160
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   7
      Left            =   1800
      Picture         =   "frmMain.frx":137C00
      Stretch         =   -1  'True
      Top             =   3240
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   6
      Left            =   2880
      Picture         =   "frmMain.frx":13956A
      Stretch         =   -1  'True
      Top             =   720
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   5
      Left            =   3600
      Picture         =   "frmMain.frx":13AED4
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   4
      Left            =   7920
      Picture         =   "frmMain.frx":13C83E
      Stretch         =   -1  'True
      Top             =   3960
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   3
      Left            =   4680
      Picture         =   "frmMain.frx":13E1A8
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   2
      Left            =   720
      Picture         =   "frmMain.frx":13FB12
      Stretch         =   -1  'True
      Top             =   3240
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   1
      Left            =   7560
      Picture         =   "frmMain.frx":14147C
      Stretch         =   -1  'True
      Top             =   3600
      Width           =   375
   End
   Begin VB.Image Weak 
      Height          =   375
      Index           =   0
      Left            =   5400
      Picture         =   "frmMain.frx":142DE6
      Stretch         =   -1  'True
      Top             =   1080
      Width           =   375
   End
   Begin VB.Image SpeedUp 
      Height          =   375
      Left            =   6120
      Picture         =   "frmMain.frx":144750
      Stretch         =   -1  'True
      Top             =   360
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.Image Enemy 
      Height          =   375
      Index           =   5
      Left            =   720
      Stretch         =   -1  'True
      Top             =   3600
      Width           =   375
   End
   Begin VB.Image Enemy 
      Height          =   375
      Index           =   4
      Left            =   2880
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.Image Enemy 
      Height          =   375
      Index           =   3
      Left            =   5400
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.Image Enemy 
      Height          =   375
      Index           =   2
      Left            =   1080
      Stretch         =   -1  'True
      Top             =   1440
      Width           =   375
   End
   Begin VB.Image Enemy 
      Height          =   375
      Index           =   1
      Left            =   5400
      Stretch         =   -1  'True
      Top             =   3240
      Width           =   375
   End
   Begin VB.Image Enemy 
      Height          =   375
      Index           =   0
      Left            =   3240
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.Image Bman 
      Height          =   375
      Left            =   360
      Stretch         =   -1  'True
      Top             =   360
      Width           =   375
   End
   Begin VB.OLE EnemyDie 
      Class           =   "SoundRec"
      Height          =   375
      Left            =   7080
      OleObjectBlob   =   "frmMain.frx":147582
      TabIndex        =   1
      Top             =   720
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.OLE BManDie 
      BackColor       =   &H0005CB05&
      Class           =   "SoundRec"
      Height          =   375
      Left            =   6840
      OleObjectBlob   =   "frmMain.frx":14AF9A
      TabIndex        =   0
      Top             =   720
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.Image BManRemains 
      Height          =   375
      Left            =   6840
      Picture         =   "frmMain.frx":14F5B2
      Stretch         =   -1  'True
      Top             =   360
      Visible         =   0   'False
      Width           =   375
   End
   Begin VB.Menu mnufile 
      Caption         =   "file"
      Visible         =   0   'False
      Begin VB.Menu mnuHTP 
         Caption         =   "How To Play"
      End
      Begin VB.Menu mnULINE 
         Caption         =   "-"
      End
      Begin VB.Menu mnuAbout 
         Caption         =   "About..."
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'IMMEDIATE
'--need to add 4 more levels

Dim NoUp As Boolean
Dim NoDown As Boolean
Dim NoLeft As Boolean
Dim NoRight As Boolean
Dim Release As Boolean
Dim MaxedOut4Bombs As Boolean

Dim Direc As String
Dim EnDirec As String
Dim LastDir(15) As String

Dim NumberOfWeakBlocks As Integer
Dim NumberOfRocks As Integer
Dim GreaterVal As Integer
Dim RandNum1 As Integer
Dim RandNum2 As Integer
Dim Choices As Integer
Dim StartLeft As Integer
Dim StartTop As Integer
Dim Ched As Integer
Dim Chex As Integer
Dim Chev As Integer
Dim Chey As Integer
Dim EFCount As Integer
Dim MaxLevels As Integer

Sub Pause(inter)
Current = Timer
Do While Timer - Current < Val(inter)
DoEvents
Loop
End Sub

Private Sub BombDelay_Timer()
Bomb1.Visible = False
Flame(0).Left = Bomb1.Left: Flame(0).Top = Bomb1.Top: Flame(0).Visible = True
'put the default set of flames in place:
Flame(1).Left = Bomb1.Left - 360: Flame(1).Top = Bomb1.Top
Flame(2).Top = Bomb1.Top - 360: Flame(2).Left = Bomb1.Left
Flame(3).Left = Bomb1.Left + 360: Flame(3).Top = Bomb1.Top
Flame(4).Top = Bomb1.Top + 360: Flame(4).Left = Bomb1.Left
Flame(5).Left = Bomb1.Left - 720: Flame(5).Top = Bomb1.Top
Flame(6).Top = Bomb1.Top - 720: Flame(6).Left = Bomb1.Left
Flame(7).Left = Bomb1.Left + 720: Flame(7).Top = Bomb1.Top
Flame(8).Top = Bomb1.Top + 720: Flame(8).Left = Bomb1.Left
If NumFlames >= 12 Then 'if bomb is powered up by 1.
Flame(9).Left = Bomb1.Left - 1080: Flame(9).Top = Bomb1.Top
Flame(10).Top = Bomb1.Top - 1080: Flame(10).Left = Bomb1.Left
Flame(11).Left = Bomb1.Left + 1080: Flame(11).Top = Bomb1.Top
Flame(12).Top = Bomb1.Top + 1080: Flame(12).Left = Bomb1.Left
End If
If NumFlames >= 16 Then 'if bomb has been pumped 2 times:
Flame(13).Left = Bomb1.Left - 1440: Flame(13).Top = Bomb1.Top
Flame(14).Top = Bomb1.Top - 1440: Flame(14).Left = Bomb1.Left
Flame(15).Left = Bomb1.Left + 1440: Flame(15).Top = Bomb1.Top
Flame(16).Top = Bomb1.Top + 1440: Flame(16).Left = Bomb1.Left
End If
If NumFlames = 20 Then 'if bomb is FULLY pumped (watch out!)
Flame(17).Left = Bomb1.Left - 1800: Flame(17).Top = Bomb1.Top
Flame(18).Top = Bomb1.Top - 1800: Flame(18).Left = Bomb1.Left
Flame(19).Left = Bomb1.Left + 1800: Flame(19).Top = Bomb1.Top
Flame(20).Top = Bomb1.Top + 1800: Flame(20).Left = Bomb1.Left
End If
'now see if a collision occured:
'(this is probably the part that will make the game slow down for people with slower computers...especially if you have the bomb charged a lot)
For i = 0 To NumFlames 'for each flame
 For j = 0 To NumberOfWeakBlocks ' for each weak block
  For l = 0 To NumberOfRocks
   If Flame(i).Tag <> "X" And Flame(i).Left = Rock(l).Left And Flame(i).Top = Rock(l).Top Then
    Flame(i).Tag = "X" '-will not appear
    On Error Resume Next
    Flame(i + 4).Tag = "X" 'next one won't either
    Flame(i + 8).Tag = "X" 'the next one too (if applicable)
    Flame(i + 12).Tag = "X" '''
    Flame(i + 16).Tag = "X" '''
   End If
   If Flame(i).Tag <> "X" And Flame(i).Left = Weak(j).Left And Flame(i).Top = Weak(j).Top Then
    Flame(i).Tag = "X" '-will not appear!
    Weak(j).Tag = "X"
    On Error Resume Next
    Flame(i + 4).Tag = "X" '-make sure that outermore flames also don't appear
    Flame(i + 8).Tag = "X" 'even more outer ones dont appear or have any effect
    Flame(i + 12).Tag = "X" '''
    Flame(i + 16).Tag = "X" '''
   End If
  Next l
 Next j
Next i
'set the appropriate flames as visible (finally!):
For n = 0 To NumFlames
 If Flame(n).Tag = "" Then Flame(n).Visible = True
Next n
'dissolve all the hit weak blocks and MAYBE give a powerup (or powerdown.. hehe)
For p = 0 To NumberOfWeakBlocks
 If Weak(p).Tag = "X" Then
  RandNum2 = Int(Rnd * 40)
   If RandNum2 = 0 Or RandNum2 = 1 Or RandNum2 = 2 Then
    If Slowed = True Or SpeedUp.Top = -1000 Or SpeedUp.Visible = True Then GoTo AlreadyGotIt  'already got it once or it's already there.
     SpeedUp.Top = Weak(p).Top
     SpeedUp.Left = Weak(p).Left
     SpeedUp.Visible = True
   ElseIf RandNum2 = 3 Or RandNum2 = 4 Then
    If EnemyFreeze.Top = -1000 Or EnemyFreeze.Visible = True Then GoTo AlreadyGotIt
     EnemyFreeze.Top = Weak(p).Top
     EnemyFreeze.Left = Weak(p).Left
     EnemyFreeze.Visible = True
   ElseIf RandNum2 = 5 Or RandNum2 = 6 Or RandNum2 = 7 Then
    If BiggerBomb.Visible = True Or BiggerBomb.Top = -2000 Then GoTo AlreadyGotIt
     If BiggerBomb.Top = -1000 And EFCount <= 4 Then
      If EFCount = 3 Then
      GoTo AlreadyGotIt
      End If
      BiggerBomb.Top = Weak(p).Top
      BiggerBomb.Left = Weak(p).Left
      BiggerBomb.Visible = True
     End If
   ElseIf RandNum2 = 8 Then
    If DeathPills.Top = -1000 Or DeathPills.Visible = True Then GoTo AlreadyGotIt
    DeathPills.Top = Weak(p).Top
    DeathPills.Left = Weak(p).Left
    DeathPills.Visible = True
   ElseIf RandNum2 = 9 Or RandNum2 = 10 Then
    If Slow.Top = -1000 Or Slow.Visible = True Then GoTo AlreadyGotIt
    Slow.Top = Weak(p).Top
    Slow.Left = Weak(p).Left
    Slow.Visible = True
    'HOVER BOOTS are a HUGE advantage.  they may be too good.  if u want to add them just add use the next 5 lines of code in each sections!
   'ElseIf RandNum2 = 11 Then
    'If Hover.Top = -1000 Or Hover.Visible = True Then GoTo AlreadyGotIt
    'Hover.Top = Weak(p).Top
    'Hover.Left = Weak(p).Left
    'Hover.Visible = True
   ElseIf RandNum2 = 12 Then
    If Heart.Top = -1000 Or Heart.Visible = True Then GoTo AlreadyGotIt
    Heart.Top = Weak(p).Top
    Heart.Left = Weak(p).Left
    Heart.Visible = True
   ElseIf RandNum2 > 12 And RandNum2 < 16 Then 'half the time nothing happens at all...
    If MaxedOut4Bombs = True Or ExtraBomb.Visible = True Then GoTo AlreadyGotIt
    ExtraBomb.Top = Weak(p).Top
    ExtraBomb.Left = Weak(p).Left
    ExtraBomb.Visible = True
   ElseIf RandNum2 > 15 And RandNum2 < 18 Then
    If TI.Top = -1000 Or TI.Visible = True Then GoTo AlreadyGotIt
    TI.Top = Weak(p).Top
    TI.Left = Weak(p).Left
    TI.Visible = True
   Else
   GoTo AlreadyGotIt 'so u only get something less than half the time
   End If
AlreadyGotIt: 'you can only get one of some of them once each level.
  Weak(p).Top = -1000 'see ya!
  PlayerScore = PlayerScore + 25
End If
Next p
Leave:
'clear tags so it works more than once:
If NumberOfEnemies > NumberOfWeakBlocks Then GreaterVal = NumberOfEnemies
If NumberOfEnemies < NumberOfWeakBlocks Then GreaterVal = NumberOfWeakBlocks
For q = 0 To GreaterVal
 On Error Resume Next
 Weak(q).Tag = ""
 Flame(q).Tag = ""
Next q
'set flame delay - so it looks like a flash of flame:
PlayWav App.Path + "\Sounds\bombexplode3.wav"
Pause 0.6 'momentary pause so u can at least see them for a lil' while. (on a slow pc, the bomb will disappear then a sec later the flames will show.  this is just the comp thinking thru all those arduous for next statements above...)
For i = 0 To 20
'plz notice that i want to go the full 20, even though all of them may not even be activated.  the reason is cause sometimes when you killed yourself w/ big bombs, some of the flames would remain 

⌨️ 快捷键说明

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