⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startup.frm

📁 利用Visual Basic编写敲冰块游戏源代码
💻 FRM
📖 第 1 页 / 共 3 页
字号:
      Top             =   5040
      Width           =   1695
   End
   Begin VB.Label Label10 
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "Exit Game"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   6720
      TabIndex        =   45
      Top             =   4920
      Visible         =   0   'False
      Width           =   2175
   End
   Begin VB.Label Label7 
      BackColor       =   &H00000000&
      Caption         =   "High Scores"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   2760
      TabIndex        =   41
      Top             =   5040
      Width           =   1935
   End
   Begin VB.Label Label6 
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "New Game!"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   360
      TabIndex        =   43
      Top             =   5040
      Width           =   1935
   End
   Begin VB.Label Label11 
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "High Scores"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   2520
      TabIndex        =   46
      Top             =   4920
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.Label Label9 
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "New Game!"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   120
      TabIndex        =   44
      Top             =   4920
      Visible         =   0   'False
      Width           =   2415
   End
   Begin VB.Label Label14 
      BackColor       =   &H00000000&
      Caption         =   "Skins"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FF00&
      Height          =   375
      Left            =   5280
      TabIndex        =   47
      Top             =   5040
      Width           =   975
   End
   Begin VB.Label Label15 
      BackColor       =   &H00000000&
      BackStyle       =   0  'Transparent
      Caption         =   "Skins"
      BeginProperty Font 
         Name            =   "Verdana"
         Size            =   18
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   495
      Left            =   5160
      TabIndex        =   48
      Top             =   4920
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.Menu File 
      Caption         =   "&File"
      Begin VB.Menu exit 
         Caption         =   "&Exit"
      End
   End
   Begin VB.Menu help 
      Caption         =   "&Help"
      Begin VB.Menu helpwithbrix 
         Caption         =   "&Help With Brix 2000"
      End
      Begin VB.Menu about 
         Caption         =   "&About Brix 2000"
      End
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a, ballspeed, points As Integer
Public Function FileExists(FileNa As String) As Boolean
    Dim FRes As String
    On Error GoTo NotFound
    FRes = Dir$(FileNa)
    If FRes = "" Then FileExists = False Else FileExists = True
NotFound:
    If Err = 53 Then Resume Next
End Function
Public Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String
   Dim strbuffer As String
   Let strbuffer$ = String$(750, Chr$(0&))
   Let ReadINI$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
End Function
Public Sub WriteINI(strsection As String, strkey As String, strkeyvalue As String, strfullpath As String)
    Call WritePrivateProfileString(strsection$, UCase$(strkey$), strkeyvalue$, strfullpath$)
End Sub

Private Sub about_Click()

Me.Enabled = False
Form11.Show

End Sub

Private Sub exit_Click()
Unload Me
End Sub
Public Sub Form_Load()
If Form1.Visible = False Then Unload Form1
If FileExists(App.Path & "\brix.ini") Then
    X = ReadINI("Settings", "Ballspeed", App.Path & "\brix.ini")
    HScroll1.Value = X
    checkpoints
Else
Call WriteINI("Scores", "Score1", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score2", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score3", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score4", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score5", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score6", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score7", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score8", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score9", "0", App.Path & "\brix.ini")
Call WriteINI("Scores", "Score10", "0", App.Path & "\brix.ini")
Call WriteINI("Names", "Score1", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score2", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score3", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score4", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score5", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score6", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score7", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score8", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score9", "Empty", App.Path & "\brix.ini")
Call WriteINI("Names", "Score10", "Empty", App.Path & "\brix.ini")
Call WriteINI("Skins", "Ball", "1200", App.Path & "\brix.ini")
Call WriteINI("Skins", "Paddle", "Paddle1", App.Path & "\brix.ini")
Call WriteINI("Settings", "Ballspeed", "20", App.Path & "\brix.ini")
X = ReadINI("Settings", "Ballspeed", App.Path & "\brix.ini")
HScroll1.Value = X
checkpoints
End If

End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload Form2
Unload Form3
Unload Form4
Unload Form5
Unload Form6
Unload Form7
Unload Form8
Unload Form9
Unload Form10
End Sub
Private Sub HScroll1_Change()
Label4.Caption = HScroll1.Value
Call WriteINI("Settings", "Ballspeed", HScroll1.Value, App.Path & "\brix.ini")
checkpoints
End Sub
Private Sub HScroll1_Scroll()
Label4.Caption = HScroll1.Value
Call WriteINI("Settings", "Ballspeed", HScroll1.Value, App.Path & "\brix.ini")
checkpoints
End Sub
Private Sub checkpoints()
If HScroll1.Value < 10 Then Label16.Caption = "Points Per Brick: 5"
If HScroll1.Value > 10 Then Label16.Caption = "Points Per Brick: 10"
If HScroll1.Value > 20 Then Label16.Caption = "Points Per Brick: 15"
If HScroll1.Value > 30 Then Label16.Caption = "Points Per Brick: 20"
If HScroll1.Value > 40 Then Label16.Caption = "Points Per Brick: 25"
If HScroll1.Value > 50 Then Label16.Caption = "Points Per Brick: 30"
If HScroll1.Value > 60 Then Label16.Caption = "Points Per Brick: 35"

If HScroll1.Value = 10 Then Label16.Caption = "Points Per Brick: 5"
If HScroll1.Value = 20 Then Label16.Caption = "Points Per Brick: 10"
If HScroll1.Value = 30 Then Label16.Caption = "Points Per Brick: 15"
If HScroll1.Value = 40 Then Label16.Caption = "Points Per Brick: 20"
If HScroll1.Value = 50 Then Label16.Caption = "Points Per Brick: 25"
If HScroll1.Value = 60 Then Label16.Caption = "Points Per Brick: 30"
End Sub
Private Sub Label10_Click()
    Unload Me
End Sub

Private Sub Label11_Click()
Me.Visible = False
Label7.Visible = True
Label11.Visible = False
Form6.Show
End Sub
Private Sub Label14_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label14.Visible = False
Label15.Visible = True
Label6.Visible = True
Label9.Visible = False
Label7.Visible = True
Label11.Visible = False
Label10.Visible = False
Label8.Visible = True
End Sub
Private Sub Label15_Click()
Label14.Visible = True
Label15.Visible = False
Me.Enabled = False
Form10.Show
End Sub
Private Sub Label6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label6.Visible = False
Label9.Visible = True
Label7.Visible = True
Label11.Visible = False
Label10.Visible = False
Label8.Visible = True
Label14.Visible = True
Label15.Visible = False
End Sub
Private Sub Label7_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label7.Visible = False
Label11.Visible = True
Label9.Visible = False
Label6.Visible = True
Label10.Visible = False
Label8.Visible = True
Label14.Visible = True
Label15.Visible = False
End Sub
Private Sub Label8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label8.Visible = False
Label10.Visible = True
Label9.Visible = False
Label6.Visible = True
Label7.Visible = True
Label11.Visible = False
Label14.Visible = True
Label15.Visible = False
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label9.Visible = False
Label6.Visible = True
Label7.Visible = True
Label11.Visible = False
Label10.Visible = False
Label8.Visible = True
Label14.Visible = True
Label15.Visible = False
End Sub
Private Sub Label9_Click()
If FileExists(App.Path & "\brix.ini") Then
Form1.Show
Unload Me
Else: MsgBox "Brix.ini file missing or corrupted. Please restart the game to fix this problem.", vbCritical
End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -