电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

基于c#的网络军棋设计毕业设计

基于c#的网络军棋设计毕业设计_第1页
1/73
基于c#的网络军棋设计毕业设计_第2页
2/73
基于c#的网络军棋设计毕业设计_第3页
3/73
摘 要本文详细介绍了一个网络对战军棋游戏的设计和实现。对于军棋游戏来说,规则非常简单,就是根据先后顺序在棋盘上走棋吃子,直到一方最先将对方的“军旗”挖掉为胜。该 游 戏 使 用 C# 编 程 实 现 在 网 络 中 的 通 信 。 这 里 使 用 了 UDP ( User Data Protocol)。UDP 是用户数据文报协议的简称,两台计算机之间的传输类似于传递邮件;两台之间没有明确的连接,使用 UDP 协议建立对等通信。游戏开始后,创建一个线程。启动线程后,通过不断侦听本机设定的端口,得到对方发送来的信息,根据自己定义的通信协议中传送的是“输赢信息”、“下的棋子位置信息”、“重新开始”等信息而分别处理。发送信息较为简单,主要实现创建 UDP 网络服务,传送信息到指定计算机的端口号后,关闭 UDP 服务。游戏最终实现了在网络中创建游戏、加入游戏等功能,可以实现在网络中联机对战的要求。关键词:军棋;UDP;C#Abstract This paper describes the design and implementation of the Versus-network Jun Qi.Game rules are very simple:take turns playing chess on a chess board,and the one who dig the “flag” of the other side first will be the winner. The game uses the C # programming to establish communication in the network .UDP is used there.UDP is the short for User Data Protocol.Transmission between two computers is similar to delivering the message;There is no clear connection between the two, using the UDP protocol to establish peer communications.After the start of the game, create a thread.After starting the thread ,through continuously listening to the port we set,we get information from the other side. Then process respectively "winning or losing ", "the pieces position ", "start again" and other information according to our own definition of communication protocol.Sending information is relatively simple,mainly to create UDP network services, transmit information to the designated remote port of the other computer, shut down the UDP service...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

基于c#的网络军棋设计毕业设计

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部