系统性红斑狼疮首选药:求够小游戏原代码

来源:百度文库 编辑:中科新闻网 时间:2024/04/30 10:41:32

rgegvegerg

我有一个VB开发的扫雷游戏,你要联系我,我给你发过去!
E-mail:devil0153@sina.com

Option Explicit
Dim score As Integer
Dim speed As Integer
Dim js As Integer

Sub init()
Label1.Caption = Chr(Int(Rnd * 26) + 49)
speed = Int(Rnd * 100 + 100)
Label1.Left = Int(Rnd * Form1.Width)
Label1.Top = Form1.Top
End Sub

Sub init1()
Label2.Caption = Chr(Int(Rnd * 26) + 97)
speed = Int(Rnd * 100 + 100)
Label2.Left = Int(Rnd * Form1.Width)
Label2.Top = Form1.Top
End Sub
Sub init2()
Label3.Caption = Chr(Int(Rnd * 26) + 6)
speed = Int(Rnd * 100 + 100)
Label3.Left = Int(Rnd * Form1.Width)
Label3.Top = Form1.Top
End Sub
Private Sub Command1_Click()
init
Timer1.Enabled = True
Timer2.Enabled = True
Command1.Visible = False
Command2.Visible = False
End Sub

Private Sub Command2_Click()
Unload Me
End
End Sub

Private Sub Timer1_Timer()
Label1.Top = Label1.Top + speed
If Label1.Top > Form1.Height Then
init
End If
Label2.Top = Label2.Top + speed
If Label2.Top > Form1.Height Then
init1
End If
Label3.Top = Label3.Top + speed
If Label3.Top > Form1.Height Then
init2
End If
End Sub

Private Sub Form_Load()
Randomize
Timer1.Enabled = False
Timer2.Enabled = False
Label4.Caption = 0
js = 200
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = Label1.Caption Then
init
score = score + 1
Label4.Caption = score
End If
If Chr(KeyAscii) = Label2.Caption Then
init1
score = score + 1
Label4.Caption = score
End If
If Chr(KeyAscii) = Label3.Caption Then
init2
score = score + 1
Label4.Caption = score
End If
End Sub

Private Sub Timer2_Timer()
js = js - 1
If js <= 0 Then
Timer1.Enabled = False
Label1.Caption = ""
Label2.Caption = ""
Label2.Caption = ""

Select Case score
Case Is <= 80
MsgBox "木头制作" + vbCrLf + "Don't give up,try again!"
Case Is < 200
MsgBox "木头制作" + vbCrLf + "That's right. Come on!"
Case Is < 350
MsgBox "木头制作" + vbCrLf + "Continue and you will be top gun!"
Case Is > 350
MsgBox "木头制作" + vbCrLf + "Congraduation! You have been a top gun!"
End Select
Command1.Visible = True
Command2.Visible = True
'Label4.Caption = 0
js = 200
Timer1.Enabled = False
Timer2.Enabled = False
End If
End Sub

Option Explicit
Dim score As Integer
Dim speed As Integer
Dim js As Integer

Sub init()
Label1.Caption = Chr(Int(Rnd * 26) + 49)
speed = Int(Rnd * 100 + 100)
Label1.Left = Int(Rnd * Form1.Width)
Label1.Top = Form1.Top
End Sub

Sub init1()
Label2.Caption = Chr(Int(Rnd * 26) + 97)
speed = Int(Rnd * 100 + 100)
Label2.Left = Int(Rnd * Form1.Width)
Label2.Top = Form1.Top
End Sub
Sub init2()
Label3.Caption = Chr(Int(Rnd * 26) + 6)
speed = Int(Rnd * 100 + 100)
Label3.Left = Int(Rnd * Form1.Width)
Label3.Top = Form1.Top
End Sub
Private Sub Command1_Click()
init
Timer1.Enabled = True
Timer2.Enabled = True
Command1.Visible = False
Command2.Visible = False
End Sub

Private Sub Command2_Click()
Unload Me
End
End Sub

Private Sub Timer1_Timer()
Label1.Top = Label1.Top + speed
If Label1.Top > Form1.Height Then
init
End If
Label2.Top = Label2.Top + speed
If Label2.Top > Form1.Height Then
init1
End If
Label3.Top = Label3.Top + speed
If Label3.Top > Form1.Height Then
init2
End If
End Sub

Private Sub Form_Load()
Randomize
Timer1.Enabled = False
Timer2.Enabled = False
Label4.Caption = 0
js = 200
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = Label1.Caption Then
init
score = score + 1
Label4.Caption = score
End If
If Chr(KeyAscii) = Label2.Caption Then
init1
score = score + 1
Label4.Caption = score
End If
If Chr(KeyAscii) = Label3.Caption Then
init2
score = score + 1
Label4.Caption = score
End If
End Sub

Private Sub Timer2_Timer()
js = js - 1
If js <= 0 Then
Timer1.Enabled = False
Label1.Caption = ""
Label2.Caption = ""
Label2.Caption = ""

Select Case score
Case Is <= 80
MsgBox "木头制作" + vbCrLf + "Don't give up,try again!"
Case Is < 200
MsgBox "木头制作" + vbCrLf + "That's right. Come on!"
Case Is < 350
MsgBox "木头制作" + vbCrLf + "Continue and you will be top gun!"
Case Is > 350
MsgBox "木头制作" + vbCrLf + "Congraduation! You have been a top gun!"
End Select
Command1.Visible = True
Command2.Visible = True
'Label4.Caption = 0
js = 200
Timer1.Enabled = False
Timer2.Enabled = False
End If
End Sub