home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Mind Boggle "
- ClientHeight = 6060
- ClientLeft = 3855
- ClientTop = 3090
- ClientWidth = 6960
- Icon = "Form1.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6060
- ScaleWidth = 6960
- Visible = 0 'False
- Begin VB.Timer Timer6
- Enabled = 0 'False
- Interval = 10
- Left = 3240
- Top = 3720
- End
- Begin VB.Timer Timer5
- Enabled = 0 'False
- Interval = 500
- Left = 5280
- Top = 4440
- End
- Begin VB.Timer Timer4
- Enabled = 0 'False
- Interval = 10
- Left = 3720
- Top = 4440
- End
- Begin VB.Timer Timer3
- Enabled = 0 'False
- Interval = 400
- Left = 2520
- Top = 4440
- End
- Begin MSComctlLib.Toolbar Toolbar1
- Align = 2 'Align Bottom
- Height = 645
- Left = 0
- TabIndex = 9
- Top = 5415
- Width = 6960
- _ExtentX = 12277
- _ExtentY = 1138
- ButtonWidth = 1588
- ButtonHeight = 979
- Appearance = 1
- ImageList = "ImageList1"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 3
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "Start Game"
- Key = "New"
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "space"
- Key = "space"
- Style = 4
- Object.Width = 5150
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Caption = "End Game"
- Key = "End"
- ImageIndex = 2
- EndProperty
- EndProperty
- BorderStyle = 1
- End
- Begin MSComctlLib.ImageList ImageList1
- Left = 720
- Top = 2640
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 19
- ImageHeight = 17
- MaskColor = 8421504
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 2
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":000C
- Key = ""
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "Form1.frx":016C
- Key = ""
- EndProperty
- EndProperty
- End
- Begin VB.Timer Timer2
- Enabled = 0 'False
- Interval = 900
- Left = 1440
- Top = 4440
- End
- Begin VB.Timer Timer1
- Enabled = 0 'False
- Interval = 1
- Left = 480
- Top = 4440
- End
- Begin VB.Label lblShowScore
- Alignment = 2 'Center
- BackStyle = 0 'Transparent
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 13.5
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00C0C0C0&
- Height = 375
- Left = 240
- TabIndex = 10
- Top = 240
- Width = 375
- End
- Begin VB.Label lblLabel2
- BackColor = &H00FFC0FF&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 3
- Left = -240
- TabIndex = 8
- Top = 1800
- Visible = 0 'False
- Width = 2415
- End
- Begin VB.Label lblLabel2
- BackColor = &H008080FF&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 0
- Left = 0
- TabIndex = 0
- Top = 0
- Visible = 0 'False
- Width = 2175
- End
- Begin VB.Label lblLabel2
- BackColor = &H000000FF&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 4
- Left = 2160
- TabIndex = 7
- Top = 1800
- Width = 2415
- End
- Begin VB.Label lblLabel2
- BackColor = &H0000FFFF&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 1
- Left = 2160
- TabIndex = 6
- Top = 0
- Visible = 0 'False
- Width = 2415
- End
- Begin VB.Label lblLabel2
- BackColor = &H0080C0FF&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 8
- Left = 4560
- TabIndex = 5
- Top = 3600
- Visible = 0 'False
- Width = 2415
- End
- Begin VB.Label lblLabel2
- BackColor = &H00FF8080&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 5
- Left = 4560
- TabIndex = 4
- Top = 1800
- Visible = 0 'False
- Width = 2415
- End
- Begin VB.Label lblLabel2
- BackColor = &H00800080&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 7
- Left = 2160
- TabIndex = 3
- Top = 3600
- Visible = 0 'False
- Width = 2415
- End
- Begin VB.Label lblLabel2
- BackColor = &H00008080&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 6
- Left = 0
- TabIndex = 2
- Top = 3600
- Visible = 0 'False
- Width = 2175
- End
- Begin VB.Label lblLabel2
- BackColor = &H0000FF00&
- BorderStyle = 1 'Fixed Single
- Height = 1815
- Index = 2
- Left = 4560
- TabIndex = 1
- Top = 0
- Visible = 0 'False
- Width = 2415
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- 'Eric Larson
- 'This program was my final class project for a vb 6.0 class
- Dim intCounter6 As Integer
- Dim lngVBcolors(0 To 7) As Long
- Dim intNum3 As Integer
- Dim intIndex As Integer
- Dim intlevelNum As Integer
- Dim intCheckNum As Integer
- Dim intRandomNums(0 To 11) As Integer
- Dim intCounter As Integer
- Dim intCounter1 As Integer
- Dim intCounter2 As Integer
- Dim intLabelViewA(0 To 11) As Integer
- Dim intNextLevel As Integer
- Private Sub Form_Load()
- Dim intNum As Integer
- With Form1
- .Top = (Screen.Height - Form1.Height) / 2
- .Left = (Screen.Width - Form1.Width) / 2
- End With
- Timer2.Enabled = True
- For intNum = 0 To 8
- lblLabel2(intNum).Visible = True
- Next intNum
- intScore = 3
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Const conBtns As Integer = vbYesNo + vbExclamation + vbDefaultButton1 + vbApplicationModal
- Const strHighest As String = "Total Blocks: "
- Const strName As String = "Name: "
- Const strHighestScore As String = "Highest Score"
- Dim lngRc As Long
- Dim strNameAndScore As String
- Dim intDatScore As Integer
- Dim strDatName As String
- Dim intUserResponse As Integer
- intUserResponse = MsgBox("Sure you want to exit?", conBtns, "Mind Boggle")
- If intUserResponse = vbNo Then
- Cancel = 1
- Else
- Open App.Path & "\Winner.dat" For Input As #1
- Input #1, strDatName, intDatScore
- Close #1
- If intScore > intDatScore Then
- strDatName = InputBox("Enter name:", "Mind Boggle")
- If strDatName = "" Then
- Open App.Path & "\Winner.dat" For Input As #1
- Input #1, strDatName, intDatScore
- Close #1
- strNameAndScore = strHighestScore & vbNewLine & vbNewLine & strName & strDatName & _
- vbNewLine & strHighest & intDatScore
- MsgBox strNameAndScore, vbOKOnly, "Mind Boggle"
- lngRc = sndPlaySound(App.Path & "\Bell.wav", 0)
- Exit Sub
- Else
- Open App.Path & "\Winner.dat" For Output As #1
- Write #1, strDatName, intScore
- Close #1
- strNameAndScore = strHighestScore & vbNewLine & vbNewLine & strName & strDatName & _
- vbNewLine & vbNewLine & strHighest & intScore
- MsgBox strNameAndScore, vbOKOnly, "Mind Boggle"
- End If
- Else
- Open App.Path & "\Winner.dat" For Input As #1
- Input #1, strDatName, intDatScore
- Close #1
- strNameAndScore = strHighestScore & vbNewLine & vbNewLine & strName & strDatName & _
- vbNewLine & vbNewLine & strHighest & intDatScore
- MsgBox strNameAndScore, vbOKOnly, "Mind Boggle"
- End If
- lngRc = sndPlaySound(App.Path & "\Bell.wav", 0)
- End If
- End Sub
- Private Sub lblLabel2_Click(index As Integer)
- Dim intNum1 As Integer
- Dim intLabelPickA(0 To 11) As Integer
- Dim lngRc As Long
- Const conBtns As Integer = vbOKOnly + vbExclamation + vbDefaultButton1 + vbApplicationModal
- Dim intUserResponse As Integer
- lblLabel2(index).Visible = False
- lngRc = sndPlaySound(App.Path & "\Whoosh.wav", 1)
- Timer4.Enabled = True
- intIndex = index
- intLabelPickA(intCounter1) = index
- If intCounter2 <> intlevelNum Then
- If intLabelPickA(intCounter) = intLabelViewA(intCounter) Then
- intCounter = intCounter + 1
- intCounter1 = intCounter1 + 1
- intCounter2 = intCounter2 + 1
- Exit Sub
- Else
- intCounter = 0
- intCounter1 = 0
- For intNum1 = 0 To 8
- lblLabel2(intNum1).Enabled = False
- Next intNum1
- intUserResponse = MsgBox("WRONG!", conBtns, "Great Fun")
- intNextLevel = 0
- Exit Sub
- End If
- Else
- If intLabelPickA(intCounter) = intLabelViewA(intCounter) Then
- intCounter = 0
- intCounter1 = 0
- intNextLevel = intNextLevel + 1
- For intNum1 = 0 To 8
- lblLabel2(intNum1).Enabled = False
- Next intNum1
- Timer5.Enabled = True
- Else
- intCounter = 0
- intCounter1 = 0
- For intNum1 = 0 To 8
- lblLabel2(intNum1).Enabled = False
- Next intNum1
- intUserResponse = MsgBox("WRONG!", conBtns, "Great Fun")
- intNextLevel = 0
- End If
- End If
-
- End Sub
- Private Sub Timer1_Timer()
- Dim intNum As Integer
- Dim lngRc As Long
- lngRc = sndPlaySound(App.Path & "\Whoosh.wav", 1)
- For intNum = 0 To 8
- lblLabel2(intNum).BackColor = vbYellow
- Next intNum
-
- End Sub
- Private Sub Timer2_Timer()
- Timer1.Enabled = True
- Timer2.Enabled = False
- Timer6.Enabled = True
- End Sub
- Private Sub Timer3_Timer()
- Dim lngRc As Long
- Dim intNum As Integer
- Dim intNum1 As Integer
- For intNum1 = 0 To 8
- lblLabel2(intNum1).Enabled = False
- Next intNum1
- intlevelNum = 3
- intCounter2 = 1
- intlevelNum = intlevelNum + intNextLevel
- If intlevelNum >= intScore Then
- lblShowScore.Caption = intScore
- End If
- If intlevelNum - 1 > intScore Then
- intScore = intlevelNum - 1
- End If
- If intCounter = 0 Then
- For intNum = 0 To 11
- Randomize
- intRandomNums(intNum) = Int((8 - 0 + 1) * Rnd + 0)
- Next intNum
- End If
- If intlevelNum <> intCounter Then
- Do While intCheckNum = intRandomNums(intCounter)
- Randomize
- intRandomNums(intCounter) = Int((8 - 0 + 1) * Rnd + 0)
- Loop
- lngRc = sndPlaySound(App.Path & "\Whoosh.wav", 1)
- If intNum3 >= 7 Then
- intNum3 = 0
- End If
- Select Case intNum3
- Case Is = 0
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbMagenta Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbGreen
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbMagenta
- End If
- Case Is = 1
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbYellow Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbBlack
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbYellow
- End If
- Case Is = 2
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbRed Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbBlue
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbRed
- End If
- Case Is = 3
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbCyan Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbMagenta
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbCyan
- End If
- Case Is = 4
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbWhite Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbGreen
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbWhite
- End If
- Case Is = 5
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbBlue Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbRed
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbBlue
- End If
- Case Is = 6
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbBlack Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbYellow
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbBlack
- End If
- Case Is = 7
- If lblLabel2(intRandomNums(intCounter)).BackColor = vbGreen Then
- lblLabel2(intRandomNums(intCounter)).BackColor = vbMagenta
- Else
- lblLabel2(intRandomNums(intCounter)).BackColor = vbGreen
- End If
- End Select
- intNum3 = intNum3 + 1
- intLabelViewA(intCounter) = intRandomNums(intCounter)
- intCheckNum = intRandomNums(intCounter)
- intCounter = intCounter + 1
- Else
- intCounter = 0
- For intNum1 = 0 To 8
- lblLabel2(intNum1).Enabled = True
- Next intNum1
- Timer3.Enabled = False
- End If
-
- End Sub
- Private Sub Timer4_Timer()
- lblLabel2(intIndex).Visible = True
- Timer4.Enabled = False
- End Sub
- Private Sub Timer5_Timer()
- Timer3.Enabled = True
- Timer5.Enabled = False
- End Sub
- Private Sub Timer6_Timer()
- Timer1.Interval = False
- Timer6.Enabled = False
- End Sub
- Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "New"
- intNextLevel = 0
- Timer3.Enabled = True
- Case "End"
- Unload Me
- End Select
-
- End Sub
-