求一个简单的VB小游戏 要代码和控件 急。。发到1290279431@qq.com

只要通过了老师检查追加50分... 只要通过了老师检查 追加50分 展开
 我来答
匿名用户
2012-11-20
展开全部
'添加一个时间控件就行了
Dim ax(20) As Single, ay(20) As Single, bx(20) As Single, by(20) As Single, c1(20) As Integer, c2(20) As Integer
Dim n As Long
Dim aa As Boolean

Private Sub Form_KeyPress(KeyAscii As Integer)
Dim d As Boolean
If aa = False Then
For i = 1 To 20
If KeyAscii = c1(i) And ay(i) < Me.ScaleHeight Then Call tu2(ax(i), ay(i)): ay(i) = 100: d = True: Exit For
Next i
If d = True Then GoTo 1
For i = 1 To 20
If KeyAscii = c2(i) And by(i) < Me.ScaleHeight Then Call tu2(bx(i), by(i)): by(i) = 100: Exit For
Next i
Else
For i = 1 To 20
If KeyAscii = c2(i) And by(i) < Me.ScaleHeight Then Call tu2(bx(i), by(i)): by(i) = 100: d = True: Exit For
Next i
If d = True Then GoTo 1
For i = 1 To 20
If KeyAscii = c1(i) And ay(i) < Me.ScaleHeight Then Call tu2(ax(i), ay(i)): ay(i) = 100: Exit For
Next i
End If
1:
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
Me.KeyPreview = True
aa = True
Timer1.Interval = 1000
Me.Height = 8000: Me.Width = 8000
Me.BackColor = vbBlack
Scale (0, 0)-(18, 18)
Me.AutoRedraw = True
Me.ForeColor = vbBlack
Me.Line (16, 17)-(18, 18), vbGreen, BF
Me.FontSize = 15
CurrentX = 16.1: CurrentY = 17: Print "开 始 "

End Sub
Sub tu1(X As Single, Y As Single, as1 As Integer)
Me.FontSize = 35
Me.ForeColor = QBColor((Int(X) + as1) Mod 15 + 1)
CurrentX = X: CurrentY = Y
Print Chr(as1)
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If X < 18 And X > 16 And Y > 17 And Y < 18 Then
For i = 1 To 20
c1(i) = 0: c2(i) = 0
Next i
Line (0, 0)-(40, 40), vbBlack, BF
Call Form_Load
Timer1.Enabled = True

End If
End Sub

Private Sub Timer1_Timer()
n = n + 1
If aa = True Then
If n < 19.3 Then
Randomize
ay(n) = 0
ax(n) = Rnd * 17

c1(n) = Int(Rnd * 26 + 65)

Else
Randomize
ay(n) = 0
ax(n) = Rnd * 17

c1(n) = Int(Rnd * 26 + 65)

aa = False: n = 0
End If
Else
If n < 19.3 Then
Randomize
by(n) = 0
bx(n) = Rnd * 17

c2(n) = Int(Rnd * 26 + 65)

Else
Randomize
by(n) = 0
bx(n) = Rnd * 17

c2(n) = Int(Rnd * 26 + 65)

aa = True: n = 0
End If
End If
Line (0, 0)-(40, 40), vbBlack, BF
For i = 1 To 20
ay(i) = ay(i) + 1
by(i) = by(i) + 1
Call tu1(ax(i), ay(i), c1(i))
Call tu1(bx(i), by(i), c2(i))
Next i
Me.ForeColor = vbBlack
Me.Line (16, 17)-(18, 18), vbGreen, BF
Me.FontSize = 15
CurrentX = 16.1: CurrentY = 17: Print "开 始 "
End Sub
Sub tu2(X As Single, Y As Single)
Line (X, Y + 0.2)-(X + 0.9, Y + 1.6), vbBlack, BF
End Sub
小0坏0
2012-11-17 · 超过32用户采纳过TA的回答
知道答主
回答量:149
采纳率:72%
帮助的人:48.3万
展开全部
伸手党 这种题 百度呀 直接下个 又怕雷同。恩 你自己做个猜数字的 游戏啦。 绝对小,而且简单。我是不会个你做的。不会就问
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
0yufan0
2012-11-18 · 超过14用户采纳过TA的回答
知道答主
回答量:68
采纳率:0%
帮助的人:21.1万
展开全部
楼上的他不是来找骂的……
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式