- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
VB课程设计报告---用VB语句实现贪吃蛇游戏
南 京 理 工 大 学
能源与动力工程学院
VB课程设计报告
题目1: 贪吃蛇游戏
题目2: 列车时刻查询
指导老师: 张小兵
学生姓名: 学 号:
专 业:
班 级:
2011年3月日
“帮助”窗体界面:
“设置”窗体界面:
“排行榜”窗体界面:
“关于”窗体界面:
二.贪吃蛇游戏部分代码
主窗体的部分代码:
为所有随机出现的的数字定位:
Sub ShowNumberAll()
Dim i As Integer, j As Integer
Dim k As Integer, m As Integer, l As Integer
Dim f As Boolean
Randomize
For m = 1 To 5
Do
i = Int(Rnd * 20)
j = Int(Rnd * 20)
判断数字出现的位置是否合理
f = True
For k = 1 To intNum 判断是否出现在蛇身上
If i = Int(shp(k).Left / GRID) And j = Int(shp(k).Top / GRID) Then
f = False
Exit For
End If
Next
If f = True Then
For k = 1 To m - 1 判断是否出现在已有的数字上
If i * GRID = lblNumber(k).Left And j * GRID = lblNumber(k).Top Then
f = False
Exit For
End If
Next
End If
If f = True Then
For k = 1 To 20 判断是否出现在障碍物上
For l = 1 To 20
If Maze(j + 1, i + 1, curMaze) = 1 Then
f = False
Exit For
End If
Next
Next
End If
If f = True Then
Exit Do
End If
Loop
AppleX(m) = i
AppleY(m) = j
lblNumber(m).Left = AppleX(m) * GRID
lblNumber(m).Top = AppleY(m) * GRID
Next
End Sub
为指定的数字定位:
Sub ShowNumber(m As Integer)
Dim i As Integer, j As Integer
Dim k As Integer, l As Integer
Dim f As Boolean
Randomize
Do
i = Int(Rnd * 20)
j = Int(Rnd * 20)
判断数字出现的位置是否合适
f = True
For k = 1 To intNum
If i = Int(shp(k).Left / GRID) And j = Int(shp(k).Top / GRID) Then
f = False
Exit For
End If
Next
If f = True Then
您可能关注的文档
- 辽宁省沈阳市交通物流园区工程可行性研究报告-优秀甲级资质页可研报告111页--185066595.doc
- 06.14)] 2012 4th international conference on intelligent and advanced systems (icias2012) - robust active heave compensated winch-driven overhead crane system for load transfer in ma..文档.pdf
- 辽宁省本溪市2014年中考物理试题(word版,含答案)[宝典].doc
- 12 Schools of Modern Linguistics文档.ppt
- 2.11.1-2012.11.2)] 2012 ieee 4th colombian workshop on circuits and systems (cwcas) - design and implementation of a system for travel in form of convoy of mobile platfor..文档.pdf
- 普罗科菲耶夫【第五交响曲】单开版总谱(“总谱有话说”首发_zxr831修改)-p71-139.pdf
- 路基路面工程.ppt.ppt
- 2004 informs continuous time discounted jump markov decision processes a discrete-event ap文档.pdf
- pvc管道安装施工方案解读.docx
- Verilog_多功能数字钟设计源代码.docx
- sbr工艺简介[资料].ppt
- spice simulation package for including flavor in collider events文档.pdf
- t. 1994)] proceedings of 1994 ieee workshop on power electronics in transportation - the design of an automotive low drop out regulator ic utilizing a depletion mode high voltage dmos pass e..文档.pdf
- 4. Labor, Material and Equipment Utilization文档.doc
- scaling of water flows and obstacle displacements in shallow underwater explosion field tests文档.pdf
- UploadFiles2007-449522846 - 郑州教育博客- 郑州教育信息网.ppt
- Process Plant Commissioning文档.doc
- 2011 Management Reporting on Internal Control and Accruals Quality Insights from a Comply-or-Explain Internal Control regime文档.pdf
- Unit 7 Will people have robots Section B(2a-2e)课件 .ppt.ppt
- TS16949 2002IATF 检查表.doc
文档评论(0)