home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD57855142000.psc / AIForm.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-05-14  |  5.5 KB  |  172 lines

  1. VERSION 5.00
  2. Begin VB.Form AIForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Super Snakes - AI settings - www.VBgames.co.uk"
  5.    ClientHeight    =   5052
  6.    ClientLeft      =   36
  7.    ClientTop       =   312
  8.    ClientWidth     =   4788
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   5052
  13.    ScaleWidth      =   4788
  14.    ShowInTaskbar   =   0   'False
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin VB.TextBox Text1 
  17.       Height          =   288
  18.       Left            =   2880
  19.       TabIndex        =   11
  20.       Text            =   "Custom"
  21.       ToolTipText     =   "The name of the AI setting"
  22.       Top             =   3840
  23.       Width           =   1692
  24.    End
  25.    Begin VB.CommandButton cmdSave 
  26.       Caption         =   "Save Current Settings"
  27.       Height          =   492
  28.       Left            =   3000
  29.       TabIndex        =   10
  30.       ToolTipText     =   "Saves the current AI settings under the name below"
  31.       Top             =   3240
  32.       Width           =   1452
  33.    End
  34.    Begin VB.CommandButton cmdGO 
  35.       Caption         =   "GO!!!"
  36.       Height          =   492
  37.       Left            =   3000
  38.       TabIndex        =   6
  39.       ToolTipText     =   "Click when you are happy with the AI settings"
  40.       Top             =   4440
  41.       Width           =   1452
  42.    End
  43.    Begin VB.Frame AIFrame 
  44.       Caption         =   "AI Settings"
  45.       Height          =   4812
  46.       Left            =   120
  47.       TabIndex        =   0
  48.       Top             =   120
  49.       Width           =   2532
  50.       Begin VB.FileListBox File1 
  51.          Height          =   1032
  52.          Left            =   120
  53.          Pattern         =   "*.AI"
  54.          TabIndex        =   8
  55.          ToolTipText     =   "Choose a saved setting"
  56.          Top             =   3720
  57.          Width           =   2292
  58.       End
  59.       Begin VB.HScrollBar TwitchS 
  60.          Height          =   372
  61.          LargeChange     =   10
  62.          Left            =   120
  63.          Max             =   200
  64.          Min             =   1
  65.          TabIndex        =   4
  66.          Top             =   2520
  67.          Value           =   150
  68.          Width           =   2292
  69.       End
  70.       Begin VB.HScrollBar ThinkS 
  71.          Height          =   372
  72.          LargeChange     =   10
  73.          Left            =   120
  74.          Max             =   200
  75.          Min             =   1
  76.          TabIndex        =   2
  77.          Top             =   1560
  78.          Value           =   50
  79.          Width           =   2292
  80.       End
  81.       Begin VB.Label Label2 
  82.          Caption         =   "Choose preset AI settings..."
  83.          Height          =   252
  84.          Left            =   120
  85.          TabIndex        =   9
  86.          ToolTipText     =   "Choose a saved setting"
  87.          Top             =   3480
  88.          Width           =   2292
  89.       End
  90.       Begin VB.Label TwitchL 
  91.          Caption         =   "Amount Of Twitching = 150"
  92.          Height          =   252
  93.          Left            =   120
  94.          TabIndex        =   5
  95.          ToolTipText     =   "How often the snake turns"
  96.          Top             =   3000
  97.          Width           =   2292
  98.       End
  99.       Begin VB.Label ThinkL 
  100.          Caption         =   "Amount Of Thinking = 50"
  101.          Height          =   252
  102.          Left            =   120
  103.          TabIndex        =   3
  104.          ToolTipText     =   "How much time is spent thinking"
  105.          Top             =   2040
  106.          Width           =   2292
  107.       End
  108.       Begin VB.Label Label1 
  109.          Caption         =   $"AIForm.frx":0000
  110.          Height          =   1212
  111.          Left            =   120
  112.          TabIndex        =   1
  113.          Top             =   240
  114.          Width           =   2292
  115.       End
  116.    End
  117.    Begin VB.Label InfoL 
  118.       BorderStyle     =   1  'Fixed Single
  119.       Height          =   3012
  120.       Left            =   2760
  121.       TabIndex        =   7
  122.       Top             =   120
  123.       Width           =   1932
  124.    End
  125. Attribute VB_Name = "AIForm"
  126. Attribute VB_GlobalNameSpace = False
  127. Attribute VB_Creatable = False
  128. Attribute VB_PredeclaredId = True
  129. Attribute VB_Exposed = False
  130. Private Sub cmdGO_Click()
  131. LookDist = ThinkS.Value
  132. TurnTime = 201 - TwitchS.Value
  133. OForm.Visible = True
  134. Unload Me
  135. End Sub
  136. Private Sub WriteInfo()
  137. InfoL = "Here are the AI settings. It is not recommended that you change these before your first go, but afterwards you can muck around with them for a bit of fun. You can load and save settings if you find a good combination. To save, type in a filename in the textbox and click on the button 'Save AI Settings'."
  138. End Sub
  139. Private Sub cmdSave_Click()
  140. LookDist = ThinkS.Value
  141. TurnTime = 201 - TwitchS.Value
  142. Open App.Path & "\" & Text1 & ".AI" For Random As #1 Len = 1
  143. Put #1, 1, LookDist
  144. Put #1, 3, TurnTime
  145. Close #1
  146. File1.Refresh
  147. End Sub
  148. Private Sub File1_DblClick()
  149. For i = 1 To 5
  150. Open App.Path & "\" & File1.FileName For Random As #1 Len = 1
  151. Get #1, 1, LookDist
  152. Get #1, 3, TurnTime
  153. Close #1
  154. ThinkS = LookDist
  155. TwitchS = 201 - TurnTime
  156. End Sub
  157. Private Sub Form_Load()
  158. Randomize Timer
  159. File1.Path = App.Path
  160. WriteInfo
  161. End Sub
  162. Private Sub ThinkS_Change()
  163. ThinkL = "Amount Of Thinking = " & ThinkS.Value
  164. LookDist = ThinkS.Value
  165. TurnTime = 201 - TwitchS.Value
  166. End Sub
  167. Private Sub TwitchS_Change()
  168. TwitchL = "Amount Of Twitching = " & TwitchS.Value
  169. LookDist = ThinkS.Value
  170. TurnTime = 201 - TwitchS.Value
  171. End Sub
  172.