[如何设计一个很简单的VB程序小游戏]利用vb控件做个坦克大战类的游戏即可,炮弹和坦克都用控件实现就行。唯一难点是控制控件移动以及炮弹击中目标的碰撞检测判断。给你一个简单实现代码 这是一种碰撞检测方法,下...+阅读
分太低,不过还是给你做了
Option Base 1
Private Type Stu
StuName As String
StuEnglish As String
StuMath As String
StuChem As String
StuPhys As String
End Type
Dim StuFile() As Stu
Dim Counter As Integer
Private Sub Command1_Click()
Counter = Counter + 1
ReDim Preserve StuFile(Counter)
StuFile(Counter).StuName = InputBox("请输入学生成绩")
StuFile(Counter).StuEnglish = InputBox("请输入英语成绩")
StuFile(Counter).StuMath = InputBox("请输入数学成绩")
StuFile(Counter).StuChem = InputBox("请输入化学成绩")
StuFile(Counter).StuPhys = InputBox("请输入物理成绩")
Beep
MsgBox "成绩存入成功!"
End Sub
Private Sub Command2_Click()
Dim SearchName As String
SearchName = InputBox("请输入要查询的学生姓名")
For i = 1 To Counter
'——————————————————————————————
If StuFile(i).StuName = SearchName Then
Picture1.Print "学生姓名:"; StuFile(i).StuName
Picture1.Print "英语成绩:"; StuFile(i).StuEnglish
Picture1.Print "数学成绩:"; StuFile(i).StuMath
Picture1.Print "化学成绩:"; StuFile(i).StuChem
Picture1.Print "物理成绩:"; StuFile(i).StuPhys
x = InputBox("是否继续查询?(Y/N)")
If UCase(x) = "Y" Then
Call Command2_Click
Else
Exit Sub
End If
End If
'——————————————————————————————
Next i
End Sub
Private Sub Command3_Click()
Picture1.Cls
End Sub
Private Sub Form_Load()
Command1.Caption = "输入成绩"
Command2.Caption = "查询成绩"
Command3.Caption = "清除"
End Sub
以下为关联文档:
关于一个简单的VB程序的设计Dim Num1 As Integer Dim i As Long Private Sub Command1_Click() Randomize Num1 = Int(100 * Rnd) End Sub Private Sub Form_Load() Command1_Click End Sub Private Su...
设计一个简单的VB程序Public Class Form1 Dim w As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Timer1.Enable...
关于简单VB程序设计Dim a() As Integer Private Sub Command1_Click() Dim i As Integer Dim j As Integer Dim x As Integer For i = 0 To 4 ReDim Preserve a(i) a(i) = Rnd * 100 Next i i...
VB请高手设计一个简单的程序例子:爱以下代码在VS2005环境中成功运行: Dim Tall(34) As Integer Dim i, SunAddTime As Integer Dim j As Integer For j = 1 To 35 Tall(j - 1) = j Next For i = 0 To Tall。 Le...
怎么用vb做一个简单的程序加入标签Label1,Caption设置为“你好,请输入你的姓名” 加入文本框Text1,用来输入姓名的 加入标签Label2,按照你的要求设置字体属性,autosize属性设成true 分别加入确定,继续,结束...
vb做一个游戏怎样做一个应用程序标准的答案!比喻的软件,玩游戏,但他们的编程,但在游戏中参与更多:首先必须熟悉的3DMAS,图片或动画更逼真的3D效果,而不是图片或动画,但一组或几组,甚至几十个团体,有些游戏可能达到几...
求一个简短的VB小游戏程序代码紧急!展开全部 Private Sub Command1_Click() Dim a As Integer, b As Integer, s As String MsgBox "我记住一个数,你根据我的提示猜猜是这个数是几" Randomize a = Int(Rnd * 100)...
编写一个简单VB程序可能字数太多,发不上来,我分开发。这是第一部分。关键函数在第2部分。 楼上的方法都不可用,因为计算结果太大。用双精度无法显示最后0的位数。所以,需要使用String类型来进行单...
如何用VB程序设计打地鼠游戏下面是源代码:Form1: Private Sub Form_Load() Dim temp As Integer Randomize temp = Int(Rnd * 3) + 1 Form1.Picture = LoadPicture("C:\Users\Administrator\Desktop\打地...