怎样用VB来制作游戏

怎样用VB来制作游戏,第1张

VB做游戏用DirectX是首选了,DirectX的体系很庞大,几乎Windows平台下的游戏都是基于DirectX开发的。

可以说开发游戏DirectX必学,推荐先看以下《Windows游戏开发大师技巧》等有了2D基础再看《3D游戏编程大师技巧》

用Timer控件隔一段时间更新飞机、炮d等位置(炮d应是粒子系统),并且需要用到在Form或者什么东东上面绘图的技术。

需要知道每个游戏对象在屏幕中的位置,进行2D平面碰撞检测。

感觉这样的东东用VB不是很好,面向对象程序要更好一些。

可以考虑VB中的结构,达到类似面向对象编程的效果。

Private Sub Command0_Click()

Dim x   As String

x = "●"

If Command2Caption = x Then

Command2Caption = "○"

Else

Command2Caption = "●"

End If

If Command4Caption = x Then

Command4Caption = "○"

Else

Command4Caption = "●"

End If

If Command6Caption = x Then

Command6Caption = "○"

Else

Command6Caption = "●"

End If

If Command8Caption = x Then

Command8Caption = "○"

Else

Command8Caption = "●"

End If

End Sub

Private Sub Command1_Click()

Dim x   As String

x = "●"

If Command8Caption = x Then

Command8Caption = "○"

Else

Command8Caption = "●"

End If

If Command2Caption = x Then

Command2Caption = "○"

Else

Command2Caption = "●"

End If

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

End Sub

Private Sub Command2_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command1Caption = x Then

Command1Caption = "○"

Else

Command1Caption = "●"

End If

If Command3Caption = x Then

Command3Caption = "○"

Else

Command3Caption = "●"

End If

End Sub

Private Sub Command3_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command2Caption = x Then

Command2Caption = "○"

Else

Command2Caption = "●"

End If

If Command4Caption = x Then

Command4Caption = "○"

Else

Command4Caption = "●"

End If

End Sub

Private Sub Command4_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command3Caption = x Then

Command3Caption = "○"

Else

Command3Caption = "●"

End If

If Command5Caption = x Then

Command5Caption = "○"

Else

Command5Caption = "●"

End If

End Sub

Private Sub Command5_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command4Caption = x Then

Command4Caption = "○"

Else

Command4Caption = "●"

End If

If Command6Caption = x Then

Command6Caption = "○"

Else

Command6Caption = "●"

End If

End Sub

Private Sub Command6_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command5Caption = x Then

Command5Caption = "○"

Else

Command5Caption = "●"

End If

If Command7Caption = x Then

Command7Caption = "○"

Else

Command7Caption = "●"

End If

End Sub

Private Sub Command7_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command6Caption = x Then

Command6Caption = "○"

Else

Command6Caption = "●"

End If

If Command8Caption = x Then

Command8Caption = "○"

Else

Command8Caption = "●"

End If

End Sub

Private Sub Command8_Click()

Dim x   As String

x = "●"

If Command0Caption = x Then

Command0Caption = "○"

Else

Command0Caption = "●"

End If

If Command7Caption = x Then

Command7Caption = "○"

Else

Command7Caption = "●"

End If

If Command1Caption = x Then

Command1Caption = "○"

Else

Command1Caption = "●"

End If

End Sub

Private Sub yun_Click()

If Command0Caption = x & Command1Caption = x And Command2Caption = x And Command3Caption = x And Command4Caption = x And Command5Caption = x And Command6Caption = x And Command7Caption = x And Command8Caption = x Then

Label2Caption = "成功了~~~~!!!祝贺啊!!!"

Else

Label2Caption = "又没完成!乱点个嘛啊。。"

End If

End Sub

楼上的朋友所说个人认为一些纰漏

第一,不要在设计时经常改动设计方案,否则工期会延误 难道在编码和设计的时候经常改动 在设计的时候改动与后期的改动谁会带来比较大的损失呢况且软件危机是怎样产生的 这是软件工程出现的原因吧,所以首先分析好你的游戏框架,多花时间分析上!

第二,网络版则必须写 软件设计概要书 和 用户使用说明书任何上规模的软件项目可以不写说明书 具体点吧,保留下最本质的数据流图,更多的文档资料所带来的结果就是让你的软件更容易维护,即可测性,可修改性,可理解性都必须具备

如果只是几百或者1千行并且不是太复杂的小游戏的话,并且不希望非常大的扩展下去,那就随便画画草图脑子有个大概思路就差不多可以开始了

如果楼主想用vb做,那可能不太合适,本人也只是用过它做过一些俄罗斯方块,贪食蛇之类的小游戏还有类似斗地主那样的牌类游戏

简单的说吧,首先你要知道你想做什么,并且可以用VB实现吗如果可以继续分析,怎样做 用什么样的技术等确定了之后,大概的将编码写在纸上,如果自己觉得逻辑合适就将其输入电脑运行之,并在输入电脑运行之后不段调试尽量多找一些难发现的错误

以上就是关于怎样用VB来制作游戏全部的内容,包括:怎样用VB来制作游戏、怎么用VB编写一个打飞机的小游戏、怎么用VB精简版编写小游戏等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/zz/9409660.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-28
下一篇2023-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存