home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Bomberman20246510132006.psc / frmInstructions.frm < prev    next >
Text File  |  2006-09-12  |  5KB  |  157 lines

  1. VERSION 5.00
  2. Begin VB.Form frmInstructions 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   8160
  5.    ClientLeft      =   5055
  6.    ClientTop       =   1845
  7.    ClientWidth     =   8775
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   8160
  10.    ScaleWidth      =   8775
  11.    StartUpPosition =   2  'CenterScreen
  12.    Begin VB.CommandButton cmdExit 
  13.       Caption         =   "Exit"
  14.       Height          =   375
  15.       Left            =   7200
  16.       TabIndex        =   6
  17.       Top             =   5880
  18.       Width           =   1455
  19.    End
  20.    Begin VB.TextBox txtInstr 
  21.       Height          =   1215
  22.       Left            =   360
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   4
  27.       Text            =   "frmInstructions.frx":0000
  28.       Top             =   6840
  29.       Width           =   6615
  30.    End
  31.    Begin VB.CommandButton cmdMoreInstr 
  32.       Caption         =   ">> Next >>"
  33.       Height          =   375
  34.       Index           =   1
  35.       Left            =   7200
  36.       TabIndex        =   3
  37.       Top             =   3600
  38.       Width           =   1455
  39.    End
  40.    Begin VB.CommandButton cmdMoreInstr 
  41.       Caption         =   "<< Previous <<"
  42.       Height          =   375
  43.       Index           =   0
  44.       Left            =   7200
  45.       TabIndex        =   2
  46.       Top             =   4080
  47.       Width           =   1455
  48.    End
  49.    Begin VB.CommandButton cmdPlay 
  50.       Caption         =   "Play"
  51.       Height          =   375
  52.       Left            =   7200
  53.       TabIndex        =   1
  54.       Top             =   5400
  55.       Width           =   1455
  56.    End
  57.    Begin VB.CommandButton cmdSetup 
  58.       Caption         =   "Setup"
  59.       Height          =   375
  60.       Left            =   7200
  61.       TabIndex        =   0
  62.       Top             =   4920
  63.       Width           =   1455
  64.    End
  65.    Begin VB.Label Label1 
  66.       Alignment       =   2  'Center
  67.       Appearance      =   0  'Flat
  68.       AutoSize        =   -1  'True
  69.       BackColor       =   &H80000005&
  70.       BackStyle       =   0  'Transparent
  71.       Caption         =   "How To Play"
  72.       BeginProperty Font 
  73.          Name            =   "Comic Sans MS"
  74.          Size            =   27.75
  75.          Charset         =   0
  76.          Weight          =   700
  77.          Underline       =   0   'False
  78.          Italic          =   0   'False
  79.          Strikethrough   =   0   'False
  80.       EndProperty
  81.       ForeColor       =   &H80000008&
  82.       Height          =   2295
  83.       Left            =   7200
  84.       TabIndex        =   5
  85.       Top             =   120
  86.       Width           =   1320
  87.       WordWrap        =   -1  'True
  88.    End
  89.    Begin VB.Image imgInstr 
  90.       BorderStyle     =   1  'Fixed Single
  91.       Height          =   6615
  92.       Left            =   360
  93.       Stretch         =   -1  'True
  94.       Top             =   120
  95.       Width           =   6630
  96.    End
  97. End
  98. Attribute VB_Name = "frmInstructions"
  99. Attribute VB_GlobalNameSpace = False
  100. Attribute VB_Creatable = False
  101. Attribute VB_PredeclaredId = True
  102. Attribute VB_Exposed = False
  103. Dim maxLesson As Integer        'the maximum amount of lessons
  104. Dim LessonContent() As String   'an array that holds all the lessons
  105. Dim Lesson As Integer           'the current lesson
  106.  
  107. Private Sub cmdExit_Click()
  108.     End
  109. End Sub
  110.  
  111. Private Sub cmdMoreInstr_Click(Index As Integer)
  112.     'since this button is next and previous, depending on which one was pressed
  113.     'the next/prev info/pic will show...
  114.     Lesson = (Lesson + (2 * Index) - 1) Mod maxLesson
  115.     If Lesson < 0 Then Lesson = maxLesson - 1
  116.     txtInstr.Text = "Lesson " & Lesson + 1 & ": " & LessonContent(Lesson)
  117.     imgInstr.Picture = LoadPicture("Images/InstrImg/instrPic" & Lesson & ".jpg")
  118. End Sub
  119.  
  120. Private Sub cmdPlay_Click()
  121.     SetPlayerKeys       'sets the keys
  122.     SetPlayerColours    'sets the colours
  123.     Load frmGame        '
  124.     frmGame.Show        'loads the game
  125.     Unload Me           '
  126. End Sub
  127.  
  128. Private Sub cmdSetup_Click()
  129.     Load frmSetup
  130.     frmSetup.Show   'Loads the Setup Screen
  131.     Unload Me
  132. End Sub
  133.  
  134. Private Sub Form_Load()
  135.     'the help file is found at (CurDir&"\instr.txt")
  136.     'and the images are found at (CurDir&"\Images\InstrImg\*.jpg")
  137.     Dim Data As String  'data obtain from file
  138.     ReDim LessonContent(0)  'sets the array to 0 length
  139.     Open "instr.txt" For Input As #1    'opens the instruction file for reading(input)
  140.     Do While Not EOF(1) 'loops through the file till the end is reached
  141.         Line Input #1, Data         'gets a line of data
  142.         maxLesson = maxLesson + 1   'increases the amount of lessons
  143.         Data = Replace(Data, "#R", vbCrLf)  'changes all the #R in the instructions to new lines
  144.         LessonContent(UBound(LessonContent)) = Data 'sets the info for the newest lesson
  145.         ReDim Preserve LessonContent(UBound(LessonContent) + 1) 'increases the size of the lesson array
  146.     Loop
  147.     txtInstr.Text = "Lesson " & Lesson + 1 & ": " & LessonContent(Lesson)
  148.     imgInstr.Picture = LoadPicture("Images/InstrImg/instrPic" & Lesson & ".jpg")
  149.     Lesson = 0
  150.     'sets the initial lesson and image
  151. End Sub
  152.  
  153. Private Sub Form_Unload(Cancel As Integer)
  154.     Close #1
  155.     'closes the instruction file when the form is closed
  156. End Sub
  157.