- 1、本文档共47页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
二d赛车游戏的设计与实现_大学生毕业设计论文
2D赛车游戏的设计与实现
摘 要
随着电脑的普及,游戏已成为大多数年青人的主要休闲方式,赛车价格比较昂贵,而赛车游戏则可以让那些想玩赛车却没法玩的人体验一把。爱好赛车竞速游戏的玩家们以体验比赛中的刺激为乐趣,玩家唯一的真实目的就是“最快”。
本设计所实现的赛车游戏是基于C语言设计开发的,所选用的游戏引擎是基于Directx8.0编写的。能进行赛车、赛道以及各种图片的绘制,实现各种游戏音效,获取键盘输入,单人游戏时,可与电脑控制的赛车竞速,多人游戏时可与其他玩家或电脑AI竞速。
与其他类似游戏相比,本设计所采用的碰撞检测算法,像边界矩形盒算法和颜色识别算法,不仅速度快,而且检测灵敏。多人游戏的实现是靠socket网络编程与多线程的联用,socket提供C/S模式下数据的可靠传输,多线程解决了socket等待问题,两者结合使得在局域网内的多人游戏运行比较流畅。
关键词:2D,DirectX,赛车,游戏
Design and Implementation of 2D Racing Game
Abstract
With the popularity of computer games has become a major leisure activity for most young people , cars are expensive , and racing games for those who want to play can play racing who had no opportunity to experience one. Hobby car racing game players to experience the game for fun stimulation , players only real purpose is the fastest .
This design is realized racing game based on the C language design and development , the choice of the game engine is based on Directx8.0 written . Capable of racing, track and draw various pictures , sound effects to achieve a variety of games to get keyboard input, single- player game, with computer-controlled car racing , multiplayer games with other players or computer AI racing .
Compared with other similar games , collision detection algorithms used in the design , like the bounding rectangle box algorithm and color recognition algorithm , not only fast, but also detection sensitivity . Multiplayer is achieved by the socket network programming and multi-threaded MS , socket provides reliable data transmission under C / S mode , multi-threaded socket waiting to solve the problem , a combination that makes the LAN multiplayer games run more smooth.
Keywords : 2D, DirectX, racing, game
目 录
第一章 绪论 1
1.1研究背景及意义 1
1.2赛车游戏开发环境和语言 1
1.3赛车游戏的主要功能 1
1.4赛车游戏开发的主要步骤 2
第二章 DirectX、游戏引擎和游戏结构 3
2.1 DirectX概述 3
2.2游戏引擎 3
2.2.1选用的游戏引擎结构 4
2.3游戏结构 5
2.4本章小结 6
第三章 游戏逻辑 8
3.1游戏主逻辑 8
3.2单人游戏逻辑 9
3.3多人游戏逻辑 13
3.3.1多人游戏服务器端逻辑 13
3.3.2多人游戏客户端逻辑 15
3.4显示游戏胜利 15
3.5本章小结 16
第四章 赛车碰撞检测技术 17
4.
文档评论(0)