求一份简单的VB小游戏详细代码和vb登陆界面设计代码图

VB运用所学的知识,编写一个简单的打字小游戏,游戏可设置时间和字符下落速度,若点击开始后,可适时编译显示剩余时间和所得分数,虽然游戏挺简单,但贵在学习。Vb新手尤其需要这种简单易懂的小程序:
Dim score As Integer
Dim speed As Integer
Dim typetime As Integer
Private Sub init()
lblletter1.Caption = Chr(Int(Rnd * 42) + 48)
lblletter1.Left = Int(Rnd * 2800) + 1
lblletter1.Top = 0
Private Sub init1()
lblletter2.Caption = Chr(Int(Rnd * 25) + 97)
lblletter2.Left = Int(Rnd * 2800) + 1
lblletter2.Top = 0
Private Sub Command1_Click()
score = Int(lblscore.Text)
Timer1 = True
Timer2 = True
HScroll1.Enabled = False
Command1.Enabled = False
Command2.Enabled = False
HScroll1.Enabled = False
If lbltime.Text &= 0 Then
Timer1 = False
Timer2 = False
lblletter1.Caption = &&
lblletter2.Caption = &&
Private Sub Command2_Click()
typetime = InputBox(&请输入打字时间。&, &时间设置&)
If typetime &= 0 Then
lbltime.Text = 60
lbltime.Text = typetime
Private Sub Form_KeyPress(KeyAscii As Integer)
If Chr(KeyAscii) = lblletter1.Caption Then
score = score + 1
lblscore.Text = score
If Chr(KeyAscii) = lblletter2.Caption Then
score = score + 1
lblscore.Text = score
Private Sub Form_Load()
Timer1.Enabled = False
Timer2.Enabled = False
lblletter1.AutoSize = True
lblletter2.AutoSize = True
lblletter1.Caption = &&
lblletter2.Caption = &&
lblscore.Text = 0
lblspeed.Caption = 100
lbltime.Text = 60
HScroll1.Max = 200
HScroll1.Min = 20
HScroll1.SmallChange = 5
HScroll1.LargeChange = 20
HScroll1.Value = 100
Private Sub HScroll1_Change()
lblspeed.Caption = HScroll1.Value
Private Sub Timer1_Timer()
lblletter1.Top = lblletter1.Top + lblspeed.Caption
If lblletter1.Top &= 4335 Then
lblletter2.Top = lblletter2.Top + lblspeed.Caption
If lblletter2.Top &= 4335 Then
Call init1
Private Sub Timer2_Timer()
If lbltime.Text & 0 Then
lbltime.Text = lbltime.Text - 1
Else: Select Case score / (typetime / 60)
Case Is &= 40
MsgBox (&不要放弃再试一次!&)
Case 40 To 80
MsgBox (&太棒了,继续努力哦!&)
Case 80 To 120
MsgBox (&坚持下去,你将成为打字高手!&)
Case Is & 120
MsgBox (&祝贺你!你已经是打字高手了!&)
End Select
Timer1 = False
Timer2 = False
HScroll1.Enabled = True
Command1.Enabled = True
Command2.Enabled = True
HScroll1.Enabled = True
看一下游戏界面就是这样的:
本类推荐文章
本类最新更新
最新源码下载求一个VB小游戏编程,要有代码的。。_百度知道
求一个VB小游戏编程,要有代码的。。
提问者采纳
Y + 1) = 1 Then
GoTo 2.Y = 11ZhuangTai(9, She(I), 11) = 1HuaTuChanShengShiWuEnd SubPrivate Sub QingChu()Dim I As LongFor I = 0 To UBound(She)
Me.Interval = 200Erase ZhuangTaiReDim She(2)She(0), She(C).X - 1
She(I).Y - 1
She(I).Enabled = TrueTimer1, Y) = 2Me.Height) &#47.Y)-(She(I):
ElseIf ZhuangTai(She(C).F
She(C).Y = 11ZhuangTai(10:QingChuC = UBound(She)Select Case She(C).ScaleWidth - Label1.F
She(C), 255.X + 1
She(C).Cls
.Y - 1) = 1 Then
GoTo 2, BF
End IfEnd With1.X:ZhuangTai(X.Y = 11ZhuangTai(11, She(C).Circle (She(I);.ScaleHeight - Label1, She(C), She(C).ClsTimer1.F = 0 Then Exit Sub
End IfCase 2
If ZhuangTai(She(C), &quot.WindowState = 2Set Timer1 = Controls.Y) = 2 Then
ReDim Preserve She(C)
She(C).Visible = False
End IfEnd IfC = UBound(She)If GFangXiang = True Then Exit SubSelect Case KeyCodeCase 37
If She(C);Timer1&quot, &quot.F = She(I + 1);贪吃蛇&quot.ScaleHeight = 24
Label1.F = She(C - 1),点“是”重新开始游戏, 11) = 1She(2).BackC 0 Then GoTo 1;Label1.X = She(I).X.X
She(C):With Me
ChanShengShiWu
GoTo 1; 1 Then
, She(I), 0)Label1, She(C).FNextEnd SubPrivate Sub ChanShengShiWu()Randomize Timer1.Y) = 1 Then
GoTo 2;.ScaleWidth
.X + 1, Y) &gt, vbYesNo.F = She(C - 1), Y)-(X + 1.X.Y = She(C - 1):
End IfCase 3
If ZhuangTai(She(C);暂停&quot.X
ElseIf ZhuangTai(She(C):
ElseIf ZhuangTai(She(C):
End IfCase 1
If ZhuangTai(She(C).Y = She(I).Line (X.Y) = 1 Then
GoTo 2.Y = She(C - 1).F
She(C).X + 1.5).F = 2She(0), RGB(255, HWBNextEnd SubPrivate Sub TiaoZheng()Dim I As LongFor I = 0 To UBound(She) - 1
She(I).F = 2She(1).Y) = 2 Then
ReDim Preserve She(C)
She(C).Timer&quot, .F = 1 Then Exit Sub
She(C), RGB(255.Y) = 0For I = 0 To C
Select Case She(I), She(0);VB.X + 1.FillStyle = 0Me.Add(&quot.F = 3
GFangXiang = TrueEnd SelectEnd SubPrivate Sub Form_Load()Me.BackStyle = 0Label1 = &quot, :
ElseIf ZhuangTai(She(C).X + 1
She(I), She(C), She(C), I As LongOn Error GoTo 2; 2, 0).Y = She(I).F = 3 Then Exit Sub
She(C),点“否”&Label1&quot.F = 2
GFangXiang = TrueCase 40
If She(C).Enabled = True Then
End IfEnd SelectZhuangTai(She(0).X;游戏结束.Y + 1
ChanShengShiWu
GoTo 1, &quot.ScaleWidth = 24Me, Y)-(X + 1.X = 10She(1).ScaleMode = 3
HWB = , She(I).F = She(C - 1).X - 1
She(C).X.FCase 0
If ZhuangTai(She(C), 255.X - 1.X = She(C - 1).F
She(C).Y + 0.Width) &#47.X = She(I).Y - 1
ChanShengShiWu
GoTo 1.Line (X, BFNextEnd SubPrivate Sub HuaTu()Dim I As LongFor I = 0 To UBound(She)
Me:End SubPrivate Sub Timer1_Timer()Dim C As Long贪吃蛇Private Sub Form_KeyDown(KeyCode As I , 255;, 0).FillColor = 255Me:If MsgBox(&quot.Move (Me.X = 11She(2).X + 0.Y = She(C - 1), RGB(255, (Me, 255.ForeColor = RGB(255;VB.F = 0
GFangXiang = TrueCase 38
If She(C).AutoSize = TrueLabel1.FontSize = 50ChuShiHuaEnd SubPrivate Sub Form_Resize()On Error GoTo 1, Y + 1).Y
ChanShengShiWu
GoTo 1.X.ScaleHeight = 24Me.F = She(C - 1).X = She(C - 1):X = Int(Rnd * 24)Y = Int(Rnd * 24)If ZhuangTai(X.Y + 1
End SelectNextTiaoZheng1.X;)Label1.ScaleHeight /&gt.49; 2
GFangXiang = TrueCase 39
If She(C).Y) = 1HuaTuExit Sub2, She(C).Label&quot, 11) = 1She(1).X = 9She(0), 0.X = She(C - 1), Y + 1).X = She(C - 1).5;)Set Label1 = Controls.Enabled = False
Label1, Me.F = 2 Then Exit Sub
She(C).Y = She(C - 1).Y + 1).Add(&quot.Line (She(I).X - 1.F = 2She(2):GFangXiang = FalseZhuangTai(She(C);) = vbYes Then
ChuShiHuaElse
EndEnd IfEnd SubPrivate Sub ChuShiHua()Me.Visible = True
Timer1.BackColor = &HC000&Me.Y + 1) = 2 Then
ReDim Preserve She(C)
She(C), She(C).Y - 1) = 2 Then
ReDim Preserve She(C)
She(C), 0).WindowState &lt.ScaleWidth = 24
.AutoRedraw = TrueMe.Enabled = True
Label1, Shift As Integer)Dim C As LongIf KeyCode = 27 Then EndIf KeyCode = 32 Then
界面大概有哪些控件呢?
不用放控件
提问者评价
其他类似问题
小游戏的相关知识
按默认排序
其他3条回答
15分太少.没有直接的.我也不想写.
迷宫的要么?留邮箱
连连看留邮箱
您可能关注的推广回答者:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁求做一个简单vb的打地鼠游戏。 明天要交好久没搞好_百度知道
求做一个简单vb的打地鼠游戏。 明天要交好久没搞好
求做一个简单vb的打地鼠游戏。明天要交好久没搞好
End Ifn = 0Text1 = 0End Ifn = n + 1End SubPrivate Sub Picture1_Click(Index As Integer)Select Case IndexCase IndexIf Index = i ThenTimer1.Visible = FalseNext lEnd SubPrivate Sub Command1_Click()Timer1;是否进入&quot、控件.Visible = TruePicture1(i), 4)If c = vbYes ThenTimer1;; & Text1 & vbCrLf & &quot!&kernel32&quot.Visible = FalseIf Text1 &gt.Enabled = FalseEnd IfElseMsgBox &请重新开始, n As IntegerPrivate Sub Form_Load()Timer1:Picture1(0~8)
排三列三排Timer1
Interval设为1000Text1
Text 设为0Command1 caption 设为“开始”2; 10ElseTimer1;Timer1;恭喜你过关了.Interval = Timer1:Private Declare Sub Sleep Lib &关&quot.Enabled = TrueEnd SubPrivate Sub Timer1_Timer()If i & & m + 1 & &恭喜你;= 80 Thenm = m + 1c = MsgBox(&quot、代码!&quot.Visible = FalseEnd IfRandomizei = (Rnd() * 8) Mod 10Picture1(i); 9 ThenPicture1(i).Enabled = FalseFor l = 0 To 8Picture1(l); (ByVal dwMilliseconds As Long)Dim m.Enabled = FalseText1 = Text1 + 10MsgBox &quot.Interval - 100 * (11 - m) &#47.ZOrderIf n = 10 ThenPicture1(i)。你的得分为&quot1
其他类似问题
打地鼠游戏的相关知识
按默认排序
其他1条回答
昨天也有个人问 你们不会是同学吧
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁求一份VB制作的小游戏 不要网上直接下的那种.希望成品.._百度知道
求一份VB制作的小游戏 不要网上直接下的那种.希望成品..
我有更好的答案
按默认排序
歉。如果自己制作,将会积极配合、探讨,没有
20元~要不,带程序注释。
其他类似问题
小游戏的相关知识
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁用vb做一个五子棋游戏要求双人对战,能显示步骤- -的代码(例如:玩家1 h7 ,玩家2 U4)_百度知道
用vb做一个五子棋游戏要求双人对战,能显示步骤- -的代码(例如:玩家1 h7 ,玩家2 U4)
提问者采纳
等着吧,哥这个暑假回去研究一下,写好了给你
提问者评价
谢啦 现在已经做出来了
其他类似问题
五子棋的相关知识
其他1条回答
我不相信有人愿意为你写这个代码
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁}

我要回帖

更多关于 vb登录界面代码 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信