home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / simon1 / simon1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  10.9 KB  |  402 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Simon V1.01"
  6.    ClientHeight    =   4605
  7.    ClientLeft      =   1920
  8.    ClientTop       =   1695
  9.    ClientWidth     =   6750
  10.    ForeColor       =   &H00008080&
  11.    Height          =   5295
  12.    Icon            =   SIMON1.FRX:0000
  13.    Left            =   1860
  14.    LinkMode        =   1  'Source
  15.    LinkTopic       =   "Form1"
  16.    ScaleHeight     =   4605
  17.    ScaleWidth      =   6750
  18.    Top             =   1065
  19.    Width           =   6870
  20.    Begin OptionButton Option3 
  21.       Caption         =   "Fast"
  22.       Height          =   375
  23.       Left            =   4320
  24.       TabIndex        =   14
  25.       Top             =   2880
  26.       Value           =   -1  'True
  27.       Width           =   975
  28.    End
  29.    Begin HScrollBar HScroll1 
  30.       Height          =   375
  31.       LargeChange     =   4
  32.       Left            =   360
  33.       Max             =   132
  34.       Min             =   1
  35.       TabIndex        =   9
  36.       Top             =   2640
  37.       Value           =   1
  38.       Width           =   3015
  39.    End
  40.    Begin OptionButton Option2 
  41.       Caption         =   "Medium"
  42.       Height          =   375
  43.       Left            =   4320
  44.       TabIndex        =   13
  45.       Top             =   2520
  46.       Width           =   975
  47.    End
  48.    Begin OptionButton Option1 
  49.       Caption         =   "Slow"
  50.       Height          =   375
  51.       Left            =   4320
  52.       TabIndex        =   12
  53.       Top             =   2160
  54.       Width           =   975
  55.    End
  56.    Begin Timer Timer3 
  57.       Interval        =   1000
  58.       Left            =   5880
  59.       Top             =   1920
  60.    End
  61.    Begin PictureBox Picture5 
  62.       BackColor       =   &H00000000&
  63.       Height          =   135
  64.       Left            =   360
  65.       ScaleHeight     =   105
  66.       ScaleWidth      =   2865
  67.       TabIndex        =   19
  68.       Top             =   1920
  69.       Width           =   2895
  70.    End
  71.    Begin PictureBox Picture2 
  72.       BorderStyle     =   0  'None
  73.       Height          =   735
  74.       Left            =   4440
  75.       Picture         =   SIMON1.FRX:0302
  76.       ScaleHeight     =   735
  77.       ScaleWidth      =   735
  78.       TabIndex        =   16
  79.       Top             =   1440
  80.       Width           =   735
  81.    End
  82.    Begin Timer Timer2 
  83.       Interval        =   1000
  84.       Left            =   5880
  85.       Top             =   1320
  86.    End
  87.    Begin PictureBox Picture1 
  88.       BackColor       =   &H00FF0000&
  89.       Height          =   735
  90.       Index           =   5
  91.       Left            =   2280
  92.       ScaleHeight     =   705
  93.       ScaleWidth      =   825
  94.       TabIndex        =   5
  95.       Top             =   1200
  96.       Width           =   855
  97.    End
  98.    Begin PictureBox Picture1 
  99.       BackColor       =   &H00FF00FF&
  100.       Height          =   735
  101.       Index           =   4
  102.       Left            =   1320
  103.       ScaleHeight     =   705
  104.       ScaleWidth      =   705
  105.       TabIndex        =   4
  106.       Top             =   1200
  107.       Width           =   735
  108.    End
  109.    Begin PictureBox Picture1 
  110.       BackColor       =   &H0000FF00&
  111.       Height          =   735
  112.       Index           =   3
  113.       Left            =   360
  114.       ScaleHeight     =   705
  115.       ScaleWidth      =   705
  116.       TabIndex        =   3
  117.       Top             =   1200
  118.       Width           =   735
  119.    End
  120.    Begin PictureBox Picture7 
  121.       BackColor       =   &H00000000&
  122.       Height          =   135
  123.       Left            =   360
  124.       ScaleHeight     =   105
  125.       ScaleWidth      =   2745
  126.       TabIndex        =   21
  127.       Top             =   1080
  128.       Width           =   2775
  129.    End
  130.    Begin Timer Timer1 
  131.       Enabled         =   0   'False
  132.       Interval        =   600
  133.       Left            =   5880
  134.       Top             =   720
  135.    End
  136.    Begin CommandButton Quit_button 
  137.       Caption         =   "&Quit"
  138.       Height          =   495
  139.       Left            =   4800
  140.       TabIndex        =   7
  141.       Top             =   720
  142.       Width           =   735
  143.    End
  144.    Begin CommandButton Play_Button 
  145.       Caption         =   "&Play"
  146.       Height          =   495
  147.       Left            =   3840
  148.       TabIndex        =   6
  149.       Top             =   720
  150.       Width           =   735
  151.    End
  152.    Begin PictureBox Picture6 
  153.       BackColor       =   &H00000000&
  154.       Height          =   1575
  155.       Left            =   3120
  156.       ScaleHeight     =   1545
  157.       ScaleWidth      =   105
  158.       TabIndex        =   20
  159.       Top             =   360
  160.       Width           =   135
  161.    End
  162.    Begin PictureBox Picture1 
  163.       BackColor       =   &H00004040&
  164.       ForeColor       =   &H00004040&
  165.       Height          =   735
  166.       Index           =   2
  167.       Left            =   2280
  168.       ScaleHeight     =   705
  169.       ScaleWidth      =   825
  170.       TabIndex        =   2
  171.       Top             =   360
  172.       Width           =   855
  173.    End
  174.    Begin PictureBox Picture9 
  175.       BackColor       =   &H00000000&
  176.       Height          =   1575
  177.       Left            =   2040
  178.       ScaleHeight     =   1545
  179.       ScaleWidth      =   225
  180.       TabIndex        =   23
  181.       Top             =   360
  182.       Width           =   255
  183.    End
  184.    Begin PictureBox Picture1 
  185.       BackColor       =   &H000080FF&
  186.       Height          =   735
  187.       Index           =   1
  188.       Left            =   1320
  189.       ScaleHeight     =   705
  190.       ScaleWidth      =   705
  191.       TabIndex        =   1
  192.       Top             =   360
  193.       Width           =   735
  194.    End
  195.    Begin PictureBox Picture8 
  196.       BackColor       =   &H00000000&
  197.       Height          =   1575
  198.       Left            =   1080
  199.       ScaleHeight     =   1545
  200.       ScaleWidth      =   225
  201.       TabIndex        =   22
  202.       Top             =   360
  203.       Width           =   255
  204.    End
  205.    Begin PictureBox Picture1 
  206.       BackColor       =   &H000000FF&
  207.       Height          =   735
  208.       Index           =   0
  209.       Left            =   360
  210.       ScaleHeight     =   705
  211.       ScaleWidth      =   705
  212.       TabIndex        =   0
  213.       Top             =   360
  214.       Width           =   735
  215.    End
  216.    Begin PictureBox Picture4 
  217.       BackColor       =   &H00000000&
  218.       Height          =   1695
  219.       Left            =   240
  220.       ScaleHeight     =   1665
  221.       ScaleWidth      =   105
  222.       TabIndex        =   18
  223.       Top             =   360
  224.       Width           =   135
  225.    End
  226.    Begin PictureBox Picture3 
  227.       BackColor       =   &H00000000&
  228.       Height          =   135
  229.       Left            =   240
  230.       ScaleHeight     =   105
  231.       ScaleWidth      =   2985
  232.       TabIndex        =   17
  233.       Top             =   240
  234.       Width           =   3015
  235.    End
  236.    Begin Label Label4 
  237.       Caption         =   "Label4"
  238.       FontBold        =   -1  'True
  239.       FontItalic      =   0   'False
  240.       FontName        =   "MS Sans Serif"
  241.       FontSize        =   12
  242.       FontStrikethru  =   0   'False
  243.       FontUnderline   =   0   'False
  244.       Height          =   495
  245.       Left            =   240
  246.       TabIndex        =   15
  247.       Top             =   3840
  248.       Width           =   6495
  249.    End
  250.    Begin Label Label2 
  251.       Caption         =   "Label2"
  252.       Height          =   375
  253.       Left            =   1200
  254.       TabIndex        =   10
  255.       Top             =   3240
  256.       Width           =   1455
  257.    End
  258.    Begin Label Label6 
  259.       BorderStyle     =   1  'Fixed Single
  260.       Caption         =   "ma"
  261.       Height          =   375
  262.       Left            =   5760
  263.       TabIndex        =   25
  264.       Top             =   3000
  265.       Width           =   495
  266.    End
  267.    Begin Label Label5 
  268.       Caption         =   "Score"
  269.       Height          =   255
  270.       Left            =   5760
  271.       TabIndex        =   24
  272.       Top             =   2640
  273.       Width           =   615
  274.    End
  275.    Begin Label Label3 
  276.       BackColor       =   &H00FFFFFF&
  277.       Caption         =   "Level selection"
  278.       Height          =   255
  279.       Left            =   1080
  280.       TabIndex        =   11
  281.       Top             =   2160
  282.       Width           =   1455
  283.    End
  284.    Begin Label Label1 
  285.       Caption         =   "Simon Version 1.01"
  286.       FontBold        =   -1  'True
  287.       FontItalic      =   0   'False
  288.       FontName        =   "MS Serif"
  289.       FontSize        =   13.5
  290.       FontStrikethru  =   0   'False
  291.       FontUnderline   =   0   'False
  292.       Height          =   495
  293.       Left            =   3480
  294.       TabIndex        =   8
  295.       Top             =   120
  296.       Width           =   2775
  297.    End
  298.    Begin Menu about 
  299.       Caption         =   "&About"
  300.    End
  301.    Begin Menu help 
  302.       Caption         =   "&Help"
  303.    End
  304. Sub about_Click ()
  305. Load aboutbox
  306. aboutbox.Show modal
  307. End Sub
  308. Sub help_Click ()
  309. Load form3
  310. form3.Show modal
  311. End Sub
  312. Sub HScroll1_Change ()
  313. lev = hscroll1.value
  314. form1.label2.caption = "Level: " + Str$(lev)
  315. End Sub
  316. Sub Option1_Click ()
  317. t_int = 1000
  318. End Sub
  319. Sub Option2_Click ()
  320. t_int = 600
  321. End Sub
  322. Sub Option3_Click ()
  323. t_int = 100
  324. End Sub
  325. Sub Picture1_Click (Index As Integer)
  326.  play_sounds (Index)
  327. If startup = 0 Then Exit Sub
  328. uarray(r) = Index
  329.  If uarray(r) <> parray(r) Then
  330.     r = lev - 1
  331.  Else
  332.     match = stepper
  333.  End If
  334.  r = r + 1
  335. If r = lev Then
  336. won = True
  337.  For j = 0 To lev - 1
  338.    If uarray(j) <> parray(j) Then
  339.      won = False
  340.      Exit For
  341.    End If
  342.  form1.timer3.enabled = True
  343.  Else
  344.   If r = stepper Then
  345.     i = 0
  346.     form1.label6.caption = Str$(match)
  347.     form1.timer2.enabled = True
  348.   End If
  349.  End If
  350. End Sub
  351. Sub Play_Button_Click ()
  352.   match = 0
  353.  form1.label4.caption = ""
  354.  form1.label6.caption = Str$(match)
  355.  startup = 1
  356. form1.hscroll1.enabled = False
  357. form1.option1.enabled = False
  358. form1.option2.enabled = False
  359. form1.option3.enabled = False
  360. For i = 0 To 132
  361. parray(i) = (5 * Rnd)
  362. uarray(i) = -1
  363. Next i
  364. i = 0
  365. stepper = 0
  366. r = 0
  367. match = 0
  368.  form1.timer1.interval = t_int
  369.  form1.timer1.enabled = True
  370. End Sub
  371. Sub Quit_button_Click ()
  372. End Sub
  373. Sub Timer1_Timer ()
  374. play_sounds (parray(i))
  375. If i = stepper Then
  376.  stepper = stepper + 1
  377. form1.timer1.enabled = False
  378. r = 0
  379. End If
  380. i = i + 1
  381. End Sub
  382. Sub Timer2_Timer ()
  383. form1.timer2.enabled = False
  384. form1.timer1.enabled = True
  385. End Sub
  386. Sub Timer3_Timer ()
  387. If won = True Then
  388. form1.label4.caption = "Hurrah!  You won! "
  389. form1.label4.caption = "Sorry!  You lost!  "
  390. If match = lev Then match = match - 1
  391. End If
  392. startup = 0
  393.  form1.label6.caption = Str$(match)
  394.   form1.label4.caption = form1.label4.caption + "  You matched " + Str$(match) + " out of " + Str$(lev)
  395.  For n = 1 To 20: play_sounds (Rnd * 5): Next
  396. form1.hscroll1.enabled = True
  397. form1.option1.enabled = True
  398. form1.option2.enabled = True
  399. form1.option3.enabled = True
  400.  form1.timer3.enabled = False
  401. End Sub
  402.