home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Virtually_46940172002.psc / frmSimon.frm (.txt) next >
Encoding:
Visual Basic Form  |  2002-01-07  |  20.3 KB  |  654 lines

  1. VERSION 5.00
  2. Begin VB.Form frmSimon 
  3.    AutoRedraw      =   -1  'True
  4.    BorderStyle     =   0  'None
  5.    ClientHeight    =   5520
  6.    ClientLeft      =   0
  7.    ClientTop       =   0
  8.    ClientWidth     =   5535
  9.    ControlBox      =   0   'False
  10.    Icon            =   "frmSimon.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    Picture         =   "frmSimon.frx":0E42
  13.    ScaleHeight     =   368
  14.    ScaleMode       =   3  'Pixel
  15.    ScaleWidth      =   369
  16.    ShowInTaskbar   =   0   'False
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.Label lblEmail 
  19.       BackStyle       =   0  'Transparent
  20.       Caption         =   "alienheretic@attbi.com"
  21.       BeginProperty Font 
  22.          Name            =   "Comic Sans MS"
  23.          Size            =   8.25
  24.          Charset         =   0
  25.          Weight          =   400
  26.          Underline       =   -1  'True
  27.          Italic          =   0   'False
  28.          Strikethrough   =   0   'False
  29.       EndProperty
  30.       ForeColor       =   &H00FF0000&
  31.       Height          =   255
  32.       Left            =   1800
  33.       MouseIcon       =   "frmSimon.frx":22C2C
  34.       MousePointer    =   99  'Custom
  35.       TabIndex        =   6
  36.       Top             =   5160
  37.       Width           =   1815
  38.    End
  39.    Begin VB.Image imgLevel 
  40.       Height          =   240
  41.       Index           =   2
  42.       Left            =   240
  43.       Picture         =   "frmSimon.frx":2306E
  44.       Top             =   6240
  45.       Width           =   240
  46.    End
  47.    Begin VB.Image imgLevel 
  48.       Height          =   240
  49.       Index           =   1
  50.       Left            =   0
  51.       Picture         =   "frmSimon.frx":235F8
  52.       Top             =   6240
  53.       Width           =   240
  54.    End
  55.    Begin VB.Image imgStart 
  56.       Height          =   240
  57.       Index           =   2
  58.       Left            =   240
  59.       Picture         =   "frmSimon.frx":23B82
  60.       Top             =   5940
  61.       Width           =   240
  62.    End
  63.    Begin VB.Image imgStart 
  64.       Height          =   240
  65.       Index           =   1
  66.       Left            =   0
  67.       Picture         =   "frmSimon.frx":2410C
  68.       Top             =   5940
  69.       Width           =   240
  70.    End
  71.    Begin VB.Image imgPower 
  72.       Height          =   240
  73.       Index           =   2
  74.       Left            =   240
  75.       Picture         =   "frmSimon.frx":24696
  76.       Top             =   5640
  77.       Width           =   240
  78.    End
  79.    Begin VB.Image imgPower 
  80.       Height          =   240
  81.       Index           =   1
  82.       Left            =   0
  83.       Picture         =   "frmSimon.frx":24C20
  84.       Top             =   5640
  85.       Width           =   240
  86.    End
  87.    Begin VB.Image imgBlue 
  88.       Height          =   2775
  89.       Index           =   1
  90.       Left            =   8340
  91.       Picture         =   "frmSimon.frx":251AA
  92.       Top             =   5520
  93.       Visible         =   0   'False
  94.       Width           =   2775
  95.    End
  96.    Begin VB.Image imgYellow 
  97.       Height          =   2775
  98.       Index           =   1
  99.       Left            =   8340
  100.       Picture         =   "frmSimon.frx":28058
  101.       Top             =   8280
  102.       Visible         =   0   'False
  103.       Width           =   2775
  104.    End
  105.    Begin VB.Image imgRed 
  106.       Height          =   2775
  107.       Index           =   1
  108.       Left            =   5580
  109.       Picture         =   "frmSimon.frx":2AE62
  110.       Top             =   5520
  111.       Visible         =   0   'False
  112.       Width           =   2775
  113.    End
  114.    Begin VB.Image imgGreen 
  115.       Height          =   2775
  116.       Index           =   1
  117.       Left            =   5580
  118.       Picture         =   "frmSimon.frx":2D595
  119.       Top             =   8280
  120.       Visible         =   0   'False
  121.       Width           =   2775
  122.    End
  123.    Begin VB.Image imgYellow 
  124.       Height          =   2775
  125.       Index           =   0
  126.       Left            =   8340
  127.       Picture         =   "frmSimon.frx":30364
  128.       Top             =   2760
  129.       Visible         =   0   'False
  130.       Width           =   2775
  131.    End
  132.    Begin VB.Image imgGreen 
  133.       Height          =   2775
  134.       Index           =   0
  135.       Left            =   5580
  136.       Picture         =   "frmSimon.frx":330D6
  137.       Top             =   2760
  138.       Visible         =   0   'False
  139.       Width           =   2775
  140.    End
  141.    Begin VB.Image imgBlue 
  142.       Height          =   2775
  143.       Index           =   0
  144.       Left            =   8340
  145.       Picture         =   "frmSimon.frx":35D98
  146.       Top             =   0
  147.       Visible         =   0   'False
  148.       Width           =   2775
  149.    End
  150.    Begin VB.Image imgRed 
  151.       Height          =   2775
  152.       Index           =   0
  153.       Left            =   5580
  154.       Picture         =   "frmSimon.frx":38B1E
  155.       Top             =   0
  156.       Visible         =   0   'False
  157.       Width           =   2775
  158.    End
  159.    Begin VB.Image imgLevel 
  160.       Height          =   240
  161.       Index           =   0
  162.       Left            =   3000
  163.       Picture         =   "frmSimon.frx":3B0D6
  164.       Top             =   2940
  165.       Width           =   240
  166.    End
  167.    Begin VB.Image imgPower 
  168.       Height          =   240
  169.       Index           =   0
  170.       Left            =   3000
  171.       Picture         =   "frmSimon.frx":3B660
  172.       Top             =   2340
  173.       Width           =   240
  174.    End
  175.    Begin VB.Image imgStart 
  176.       Height          =   240
  177.       Index           =   0
  178.       Left            =   3000
  179.       Picture         =   "frmSimon.frx":3BBEA
  180.       Top             =   2640
  181.       Width           =   240
  182.    End
  183.    Begin VB.Label lblLevel 
  184.       BackStyle       =   0  'Transparent
  185.       Caption         =   "Level 1"
  186.       BeginProperty Font 
  187.          Name            =   "Comic Sans MS"
  188.          Size            =   9.75
  189.          Charset         =   0
  190.          Weight          =   700
  191.          Underline       =   0   'False
  192.          Italic          =   0   'False
  193.          Strikethrough   =   0   'False
  194.       EndProperty
  195.       ForeColor       =   &H00FFFFFF&
  196.       Height          =   255
  197.       Index           =   0
  198.       Left            =   2280
  199.       TabIndex        =   2
  200.       Top             =   2880
  201.       Width           =   675
  202.    End
  203.    Begin VB.Label Label2 
  204.       BackStyle       =   0  'Transparent
  205.       Caption         =   "Power"
  206.       BeginProperty Font 
  207.          Name            =   "Comic Sans MS"
  208.          Size            =   9.75
  209.          Charset         =   0
  210.          Weight          =   700
  211.          Underline       =   0   'False
  212.          Italic          =   0   'False
  213.          Strikethrough   =   0   'False
  214.       EndProperty
  215.       ForeColor       =   &H00FFFFFF&
  216.       Height          =   255
  217.       Left            =   2280
  218.       TabIndex        =   1
  219.       Top             =   2280
  220.       Width           =   555
  221.    End
  222.    Begin VB.Label Label1 
  223.       BackStyle       =   0  'Transparent
  224.       Caption         =   "Start"
  225.       BeginProperty Font 
  226.          Name            =   "Comic Sans MS"
  227.          Size            =   9.75
  228.          Charset         =   0
  229.          Weight          =   700
  230.          Underline       =   0   'False
  231.          Italic          =   0   'False
  232.          Strikethrough   =   0   'False
  233.       EndProperty
  234.       ForeColor       =   &H00FFFFFF&
  235.       Height          =   255
  236.       Left            =   2280
  237.       TabIndex        =   0
  238.       Top             =   2580
  239.       Width           =   555
  240.    End
  241.    Begin VB.Label Label4 
  242.       BackStyle       =   0  'Transparent
  243.       Caption         =   "Power"
  244.       BeginProperty Font 
  245.          Name            =   "Comic Sans MS"
  246.          Size            =   9.75
  247.          Charset         =   0
  248.          Weight          =   700
  249.          Underline       =   0   'False
  250.          Italic          =   0   'False
  251.          Strikethrough   =   0   'False
  252.       EndProperty
  253.       Height          =   255
  254.       Left            =   2310
  255.       TabIndex        =   3
  256.       Top             =   2310
  257.       Width           =   555
  258.    End
  259.    Begin VB.Label Label5 
  260.       BackStyle       =   0  'Transparent
  261.       Caption         =   "Start"
  262.       BeginProperty Font 
  263.          Name            =   "Comic Sans MS"
  264.          Size            =   9.75
  265.          Charset         =   0
  266.          Weight          =   700
  267.          Underline       =   0   'False
  268.          Italic          =   0   'False
  269.          Strikethrough   =   0   'False
  270.       EndProperty
  271.       Height          =   255
  272.       Left            =   2310
  273.       TabIndex        =   4
  274.       Top             =   2610
  275.       Width           =   555
  276.    End
  277.    Begin VB.Label lblLevel 
  278.       BackStyle       =   0  'Transparent
  279.       Caption         =   "Level 1"
  280.       BeginProperty Font 
  281.          Name            =   "Comic Sans MS"
  282.          Size            =   9.75
  283.          Charset         =   0
  284.          Weight          =   700
  285.          Underline       =   0   'False
  286.          Italic          =   0   'False
  287.          Strikethrough   =   0   'False
  288.       EndProperty
  289.       Height          =   255
  290.       Index           =   1
  291.       Left            =   2310
  292.       TabIndex        =   5
  293.       Top             =   2910
  294.       Width           =   735
  295.    End
  296.    Begin VB.Image imgYellow 
  297.       Height          =   2775
  298.       Index           =   2
  299.       Left            =   2760
  300.       Picture         =   "frmSimon.frx":3C174
  301.       Top             =   2760
  302.       Width           =   2775
  303.    End
  304.    Begin VB.Image imgBlue 
  305.       Height          =   2775
  306.       Index           =   2
  307.       Left            =   2760
  308.       Picture         =   "frmSimon.frx":3EF7E
  309.       Top             =   0
  310.       Width           =   2775
  311.    End
  312.    Begin VB.Image imgRed 
  313.       Height          =   2775
  314.       Index           =   2
  315.       Left            =   0
  316.       Picture         =   "frmSimon.frx":41E2C
  317.       Top             =   0
  318.       Width           =   2775
  319.    End
  320.    Begin VB.Image imgGreen 
  321.       Height          =   2775
  322.       Index           =   2
  323.       Left            =   0
  324.       Picture         =   "frmSimon.frx":4455F
  325.       Top             =   2760
  326.       Width           =   2775
  327.    End
  328. Attribute VB_Name = "frmSimon"
  329. Attribute VB_GlobalNameSpace = False
  330. Attribute VB_Creatable = False
  331. Attribute VB_PredeclaredId = True
  332. Attribute VB_Exposed = False
  333. 'Vincent Foster 01/04/2002 
  334.  Copyright 2002 VBVince Software Co.
  335. 'Please Give Me credit If You Any Of My Code
  336. 'Please Vote
  337. 'alienheretic@attbi.com
  338. 'http://www.vbvince.com
  339. Option Explicit
  340. Private Declare Function ReleaseCapture Lib "user32" () As Long
  341. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  342. Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
  343. Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As Any, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
  344. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  345. Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  346. Dim GameOver As Boolean
  347. Dim AINotes(72) As Integer
  348. Dim PlayerNotes(72) As Integer
  349. Private Type POINTAPI
  350.         X As Long
  351.         Y As Long
  352. End Type
  353. Dim intPlayerTurn As Integer
  354. Dim intPlayerNotesPlayed As Integer
  355. Dim intAITurn As Integer
  356. Dim intAiNotesPlayed As Integer
  357. Const ALTERNATE = 1
  358. Dim Pts(7) As POINTAPI
  359. Dim IntLevel As Integer
  360. Enum ColorEnum
  361.     Red = 0
  362.     Green = 1
  363.     Blue = 2
  364.     Yellow = 3
  365. End Enum
  366. Private Sub Form_Load()
  367.     Paint
  368.     modMidi.InitMidi 'Initallize The Midi Device
  369.     IntLevel = 1
  370. End Sub
  371. Private Sub Paint()
  372. Dim hRgn As Long
  373. 'Shapes Our Form To The Outline Of The Simon
  374. 'Graphic Making The Corners Transparent
  375.     Pts(0).X = 116
  376.     Pts(0).Y = 0
  377.     Pts(1).X = 252
  378.     Pts(1).Y = 0
  379.     Pts(2).X = 368
  380.     Pts(2).Y = 116
  381.     Pts(3).X = 368
  382.     Pts(3).Y = 252
  383.     Pts(4).X = 252
  384.     Pts(4).Y = 368
  385.     Pts(5).X = 116
  386.     Pts(5).Y = 368
  387.     Pts(6).X = 0
  388.     Pts(6).Y = 252
  389.     Pts(7).X = 0
  390.     Pts(7).Y = 116
  391.     hRgn = CreatePolygonRgn(Pts(0), 8, ALTERNATE)
  392.     SetWindowRgn Me.hwnd, hRgn, True
  393.     DeleteObject hRgn
  394. End Sub
  395. Private Sub Form_Unload(Cancel As Integer)
  396.     modMidi.EndMidi 'Frees Up The Midi Device
  397.     Set frmSimon = Nothing 'Sets The Form To Nothing
  398. End Sub
  399. Public Sub FormDrag(TheForm As Form) 'Drags A Borderless Form
  400.     ReleaseCapture
  401.     Call SendMessage(TheForm.hwnd, &HA1, 2, 0&)
  402. End Sub
  403. Private Sub imgBlue_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  404.     If Button = 1 Then
  405.         CheckXY ((X / Screen.TwipsPerPixelX) + imgBlue(2).Left), ((Y / Screen.TwipsPerPixelY) + imgBlue(2).Top)
  406.     End If 'Call The CheckXY Mouse Map Sub
  407. End Sub
  408. Private Sub imgYellow_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  409.     If Button = 1 Then
  410.         CheckXY ((X / Screen.TwipsPerPixelX) + imgYellow(2).Left), ((Y / Screen.TwipsPerPixelY) + imgYellow(2).Top)
  411.     End If 'Call The CheckXY Mouse Map Sub
  412. End Sub
  413. Private Sub imgGreen_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  414.     If Button = 1 Then
  415.         CheckXY ((X / Screen.TwipsPerPixelX) + imgGreen(2).Left), ((Y / Screen.TwipsPerPixelY) + imgGreen(2).Top)
  416.     End If 'Call The CheckXY Mouse Map Sub
  417. End Sub
  418. Private Sub imgRed_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  419.     If Button = 1 Then
  420.         CheckXY ((X / Screen.TwipsPerPixelX) + imgRed(2).Left), ((Y / Screen.TwipsPerPixelY) + imgRed(2).Top)
  421.     End If 'Call The CheckXY Mouse Map Sub
  422. End Sub
  423. Private Sub imgLevel_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  424.     imgLevel(0).Picture = imgLevel(1).Picture
  425. End Sub
  426. Private Sub imgLevel_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  427.     imgLevel(0).Picture = imgLevel(2).Picture
  428. End Sub
  429. Private Sub imgLevel_Click(Index As Integer)
  430. Dim K As Integer 'Changes The Level Of Difficulty
  431.     IntLevel = IntLevel + 1
  432.     If IntLevel >= 10 Then
  433.         IntLevel = 1
  434.     End If
  435.     For K = 0 To 1
  436.         lblLevel(K).Caption = "Level " & IntLevel
  437.     Next
  438. End Sub
  439. Private Sub imgPower_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  440.     imgPower(0).Picture = imgPower(1).Picture
  441. End Sub
  442. Private Sub imgPower_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  443.     imgPower(0).Picture = imgPower(2).Picture
  444. End Sub
  445. Private Sub imgPower_Click(Index As Integer)
  446.     Unload Me
  447. End Sub
  448. Private Sub imgStart_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  449.     imgStart(0).Picture = imgStart(1).Picture
  450. End Sub
  451. Private Sub imgStart_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  452.     imgStart(0).Picture = imgStart(2).Picture
  453. End Sub
  454. Private Sub imgStart_Click(Index As Integer)
  455.     NewGame 'Calls The New Game Sub
  456. End Sub
  457. Public Sub NewGame()
  458. 'Begins A New Game
  459. Intro
  460. RandomizeNotes
  461. PauseNote 200
  462. intPlayerTurn = 0
  463. intPlayerNotesPlayed = 0
  464. intAITurn = 0
  465. intAiNotesPlayed = 0
  466. GameOver = False
  467. AiTurn
  468. End Sub
  469. Public Sub CheckXY(X As Single, Y As Single)
  470. 'Checks The Color Of The Mouse Map At Varrious X and Y Possitions
  471. 'And Either Allows You To Drag The Form Or Play A Simon note
  472. 'Check To Make Sure The Player Has Played The Correct Notes Or
  473. 'Calls The Youloose Sub Else Calls The YouWin Sub If The Number Of Played Notes
  474. '=50 Times The Level Of Difficulty
  475. Dim PIX As Long
  476.     PIX = GetPixel(Me.hdc, X, Y)
  477. If GameOver = True Then
  478.     Exit Sub
  479. End If
  480.     Select Case PIX
  481.     Case vbBlack
  482.         FormDrag frmSimon
  483.     Case vbBlue
  484.             AddPlayerNotes Blue
  485.             PlaySimon Blue, 200
  486.     Case vbRed
  487.             AddPlayerNotes Red
  488.             PlaySimon Red, 200
  489.     Case vbGreen
  490.             AddPlayerNotes Green
  491.             PlaySimon Green, 200
  492.     Case vbYellow
  493.             AddPlayerNotes Yellow
  494.             PlaySimon Yellow, 200
  495.     End Select
  496. intPlayerNotesPlayed = intPlayerNotesPlayed + 1
  497. intPlayerTurn = intPlayerTurn + 1
  498. If CheckWin = False Then
  499. YouLoose
  500. Exit Sub
  501. ElseIf intPlayerNotesPlayed = 1 + (7 * IntLevel) Then
  502. YouWin
  503. Exit Sub
  504. End If
  505. If intPlayerTurn = intAiNotesPlayed Then
  506. intPlayerTurn = 0
  507. AiTurn
  508. End If
  509. End Sub
  510. Public Sub RandomizeNotes()
  511. 'Randomize The computers notes to play
  512. Dim C As Integer
  513. Dim K As Integer
  514. Dim Z As Long
  515. For K = 0 To 72
  516. Randomize GetTickCount
  517. Z = Rnd * 3
  518. AINotes(K) = Z
  519. Debug.Print AINotes(K)
  520. End Sub
  521. Public Sub YouWin()
  522. 'Play The winning Sequence
  523. Dim K As Integer
  524. PauseNote 100
  525.     PlaySimon Red, 150
  526.     PlaySimon Green, 150
  527.     PlaySimon Blue, 150
  528.     PlaySimon Yellow, 150
  529.     PlaySimon Red, 150
  530.     PlaySimon Green, 150
  531.     PlaySimon Blue, 150
  532.     PlaySimon Yellow, 150
  533.     PlaySimon Yellow, 150
  534.     PlaySimon Yellow, 150
  535.     PlaySimon Green, 150
  536.     PlaySimon Blue, 150
  537.     PlaySimon Yellow, 150
  538.     GameOver = True
  539. End Sub
  540. Public Sub PlaySimon(eColor As ColorEnum, Durration As Long)
  541. 'Play The Approiate Note and Highlight The Picture
  542. Select Case eColor
  543. Case 0
  544.     imgRed(2).Picture = imgRed(0).Picture
  545.     imgRed(2).Refresh
  546.     modMidi.PlayNote 36, 1, 127, Durration
  547. Case 1
  548.     imgGreen(2).Picture = imgGreen(0).Picture
  549.     imgGreen(2).Refresh
  550.     modMidi.PlayNote 40, 1, 127, Durration
  551. Case 2
  552.     imgBlue(2).Picture = imgBlue(0).Picture
  553.     imgBlue(2).Refresh
  554.     modMidi.PlayNote 43, 1, 127, Durration
  555. Case 3
  556.     imgYellow(2).Picture = imgYellow(0).Picture
  557.     imgYellow(2).Refresh
  558.     modMidi.PlayNote 48, 1, 127, Durration
  559. End Select
  560.     ResetButtons
  561. End Sub
  562. Public Sub ResetButtons()
  563. 'Darken All The Buttons
  564.     imgBlue(2).Picture = imgBlue(1).Picture
  565.     imgYellow(2).Picture = imgYellow(1).Picture
  566.     imgGreen(2).Picture = imgGreen(1).Picture
  567.     imgRed(2).Picture = imgRed(1).Picture
  568.     imgBlue(2).Refresh
  569.     imgYellow(2).Refresh
  570.     imgGreen(2).Refresh
  571.     imgRed(2).Refresh
  572. End Sub
  573. Public Sub LightAllButtons()
  574. 'Light All The Buttons
  575.     imgBlue(2).Picture = imgBlue(0).Picture
  576.     imgYellow(2).Picture = imgYellow(0).Picture
  577.     imgGreen(2).Picture = imgGreen(0).Picture
  578.     imgRed(2).Picture = imgRed(0).Picture
  579.     imgBlue(2).Refresh
  580.     imgYellow(2).Refresh
  581.     imgGreen(2).Refresh
  582.     imgRed(2).Refresh
  583. End Sub
  584. Public Sub YouLoose()
  585. 'Play The Loosing Sequence
  586. Dim K As Integer
  587. PauseNote 100
  588.     For K = 0 To 2
  589.         LightAllButtons
  590.         modMidi.PlayNote 26, 1, 127, 250
  591.         ResetButtons
  592.         PauseNote 200
  593.     Next
  594.    GameOver = True
  595. End Sub
  596. Public Sub Intro()
  597. 'Play An Introduction Of A New Game
  598. Dim K As Integer
  599.     PlaySimon Red, 150
  600.     PlaySimon Blue, 150
  601.     PlaySimon Yellow, 150
  602.     PlaySimon Green, 150
  603.     PlaySimon Red, 150
  604.     PlaySimon Blue, 150
  605.     PlaySimon Yellow, 150
  606.     PlaySimon Green, 150
  607.     LightAllButtons
  608.     modMidi.PlayNote 26, 1, 127, 200
  609.     ResetButtons
  610.     PauseNote 200
  611. End Sub
  612. Public Function CheckWin() As Boolean
  613. 'Compare The Players Array Of Played Notes with The Computers
  614. Dim K As Integer
  615.     For K = 0 To (intPlayerNotesPlayed - 1)
  616.         If PlayerNotes(K) = AINotes(K) Then
  617.             CheckWin = True
  618.         Else
  619.             CheckWin = False
  620.         End If
  621.     Next
  622. End Function
  623. Public Sub AddPlayerNotes(eColor As ColorEnum)
  624. 'Add Current Note To The Players Note Array
  625.     Select Case eColor
  626.     Case Red
  627.         PlayerNotes(intPlayerNotesPlayed) = 0
  628.     Case Green
  629.         PlayerNotes(intPlayerNotesPlayed) = 1
  630.     Case Blue
  631.         PlayerNotes(intPlayerNotesPlayed) = 2
  632.     Case Yellow
  633.         PlayerNotes(intPlayerNotesPlayed) = 3
  634.     End Select
  635. End Sub
  636. Public Sub AiTurn()
  637. Dim K As Integer
  638. If GameOver = True Then
  639.     Exit Sub
  640. End If
  641. intAiNotesPlayed = 0 'Reset The Number Of Notes The Computer Has Played To 0
  642. intPlayerNotesPlayed = 0 'Reset The Number Of Notes The Player Has Played To 0
  643. PauseNote 600
  644.     For K = 0 To intAITurn
  645.     PlaySimon (AINotes(K)), 200 'Play The Sequence
  646.     PauseNote 200
  647.     intAiNotesPlayed = intAiNotesPlayed + 1 'Add One To The Number Of Notes The Computer Has Played
  648.     Next
  649. intAITurn = intAITurn + IntLevel 'Count The Turns The Computer Has Had
  650. End Sub
  651. Private Sub lblEmail_Click()
  652. sendemail
  653. End Sub
  654.