英语翻译Private Sub cmdgame_Click() Formstart.ShowUnload MeEnd SubPrivate Sub cmdexit_Click()Unload MeEnd SubPrivate Sub cmdstart_Click()Formlevel1.MousePointer = 2Label1.Visible = FalseIf cmdstart.Caption = "开始" ThenTimerimage.Enabled = True

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 14:46:10
英语翻译Private Sub cmdgame_Click() Formstart.ShowUnload MeEnd SubPrivate Sub cmdexit_Click()Unload MeEnd SubPrivate Sub cmdstart_Click()Formlevel1.MousePointer = 2Label1.Visible = FalseIf cmdstart.Caption =

英语翻译Private Sub cmdgame_Click() Formstart.ShowUnload MeEnd SubPrivate Sub cmdexit_Click()Unload MeEnd SubPrivate Sub cmdstart_Click()Formlevel1.MousePointer = 2Label1.Visible = FalseIf cmdstart.Caption = "开始" ThenTimerimage.Enabled = True
英语翻译
Private Sub cmdgame_Click()
Formstart.Show
Unload Me
End Sub
Private Sub cmdexit_Click()
Unload Me
End Sub
Private Sub cmdstart_Click()
Formlevel1.MousePointer = 2
Label1.Visible = False
If cmdstart.Caption = "开始" Then
Timerimage.Enabled = True
Timertime.Enabled = True
cmdstart.Caption = "重来"
Else
Labelscore.Caption = 0
Labeltime.Caption = 60
Timerimage.Enabled = True
Timertime.Enabled = True
cmdstart.Caption = "开始"
End If
End Sub
Private Sub Image1_Click()
Image1.Visible = False
Call addscore
End Sub
Private Sub Image2_Click()
Image2.Visible = False
Call reducescore
End Sub
Private Sub Image3_Click()
Image3.Visible = False
Call addscore
End Sub
Private Sub Image4_Click()
Image4.Visible = False
Call reducescore
End Sub
Private Sub Image5_Click()
Image5.Visible = False
Call addscore
End Sub
Private Sub Image6_Click()
Image6.Visible = False
Call addscore
End Sub
Private Sub Image7_Click()
Image7.Visible = False
Call reducescore
End Sub
Private Sub Image8_Click()
Image8.Visible = False
Call reducescore
End Sub
Private Sub Image9_Click()
Image9.Visible = False
Call addscore
End Sub
Private Sub Image10_Click()
Image10.Visible = False
Call addscore
End Sub
Public Sub addscore()
Labelscore.Caption = Labelscore.Caption + 1
If Labelscore.Caption > 30 Then
MsgBox "恭喜闯关成功,你真厉害!",vbOKOnly,"结果"
Formlevel2.Show
Unload Me
End If
End Sub
Public Sub reducescore()
Labelscore.Caption = Labelscore.Caption - 1
End Sub
Private Sub timerimage_timer()
Dim a As Integer
Randomize
a = Int(Rnd * 10) + 1 '产生1~10随机数
.
Private Sub timer1_timer()
Image1.Visible = False
Timer1.Enabled = False
End Sub
Private Sub timer2_timer()
Image2.Visible = False
Timer2.Enabled = False
End Sub
Private Sub timer3_timer()
Image3.Visible = False
Timer3.Enabled = False
End Sub
Private Sub timer4_timer()
Image4.Visible = False
Timer4.Enabled = False
End Sub
Private Sub timer5_timer()
Image5.Visible = False
Timer5.Enabled = False
End Sub
Private Sub timer6_timer()
Image6.Visible = False
Timer6.Enabled = False
End Sub
Private Sub timer7_timer()
Image7.Visible = False
Timer7.Enabled = False
End Sub
Private Sub timer8_timer()
Image8.Visible = False
Timer8.Enabled = False
End Sub
Private Sub timer9_timer()
Image9.Visible = False
Timer9.Enabled = False
End Sub
Private Sub timer10_timer()
Image10.Visible = False
Timer10.Enabled = False
End Sub
Private Sub Timertime_Timer()
Labeltime.Caption = Labeltime.Caption - 1
If Labeltime.Caption = 0 Then
If Labelscore.Caption < 30 Then
Timerimage.Enabled = False
Timertime.Enabled = False
MsgBox "时间到!闯关失败,请继续努力!",vbOKOnly,"结果"
Formlevel1.MousePointer = 0
cmdstart.Caption = "重来"
Else
Formlevel1.MousePointer = 0
Timerimage.Enabled = False
Timertime.Enabled = False
End If
End If
End Sub

英语翻译Private Sub cmdgame_Click() Formstart.ShowUnload MeEnd SubPrivate Sub cmdexit_Click()Unload MeEnd SubPrivate Sub cmdstart_Click()Formlevel1.MousePointer = 2Label1.Visible = FalseIf cmdstart.Caption = "开始" ThenTimerimage.Enabled = True
这段程序是一个游戏的部分代码,在主窗口内有一些运动的图片,点到图片1,3,5,6,9,10时加1分,点到图片2,4,7,8时减1分,当分数大于30分时,显示对话框提示过关,否则到时间限制(Timetimer 和 Interval属性指定的时间)则提示闯关失败.