超清粉色系少女心壁纸:VB程序,帮忙看看错在哪里?

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 19:59:21
打字游戏代码,只是26个字母的打字游戏
Option Explicit
Dim score As Integer
Dim speed As Integer

Sub init()
Label3.Caption = Chr(Int(Rnd * 26) + 97)
Label3.Left = Int(Rnd * Frame1.Width) + Frame1.Left
Label3.Top = Frame1.Top
speed = Int(Rnd * 100) + 100
End Sub
Sub init1()
Label4.Caption = Chr(Int(Rnd * 26) + 65)
Label4.Left = Int(Rnd * Frame1.Width) + Frame1.Left
Label4.Top = Frame1.Top
speed = Int(Rnd * 100) + 100
End Sub

Private Sub Command1_Click()
Timer1.Enabled = True
Timer2.Enabled = True
init
init1
Text1.Text = 0
Text2.Text = 60
Command1.Visible = False
End Sub

Private Sub Command1_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = Label3.Caption Then init
score = score + 1
Text1.Text = score
End If
End Sub

Private Sub Form_Load()
Randomize
Timer1.Enabled = False
Timer2.Enabled = False
End Sub
Select Case score
Case Is <= 80
MsgBox
Private Sub Timer1_Timer()
Label3.Top = Label3.Top + speed
If Label3.Top >= Frame1.Height + framel.Top Then
init
End If
Label4.Top = Label4.Top + speed
If Label4.Top >= Frame1.Height + framel.Top Then
init
End If
End Sub

Private Sub Timer2_Timer()
Text2.Text = Val(Text2.Text) - 1
If Val(Text2.Text) <= 0 Then
Timer1.Enabled = False
Timer2.Enabled = False
Label3.Caption = ""
Label3.Caption = ""

End Sub

请看一下你的Form_Load()下面的过程结束之后(即End Sub),和下面的Timer1_Timer()过程之间,有
Select Case score
Case Is <= 80
MsgBox
这三行是什么意思呢???为什么不放在某一个过程中?这肯定是不会通过的.

群里应该会有人能帮助你吧
计算机语言交流群:14940080,看简介答对问题就加,欢迎加入

这个游戏我也做过,有生成的EXE文件,有空沟通沟通
把你源程序发给我看看.