利用Socket编程完成小游戏功能(程序-详细代码+演示结果-小报告)

上传者: m0_64258486 | 上传时间: 2024-06-29 20:49:00 | 文件大小: 50.15MB | 文件类型: ZIP
利用Socket编程完成如下小游戏功能: (1) 在5X5或者7X7个格子组成的地图中由服务器随机产生一名敌人和一名相距较远的玩家,服务器通知客户端(玩家)初始地图、敌人和玩家位置信息,并每次和客户端通信时计算游戏逻辑; (2)在每一回合中,玩家(客户端)输入移动方向,和这回合是否攻击,敌人动作由服务器产生; (3) 服务器根据客户端输入和敌人移动来判断敌人是否被击败或者没有被击中; (4)假设玩家只有3次攻击次数,敌人AI 移动、逻辑计算和胜负判断都在服务器端计算;玩家只能攻击到十字一格内的敌人,每回合敌人和玩家都只能移动一格,只能十字四邻域方向移动。 (5)本回合玩家使用攻击,并且敌人在本回合也移动到玩家十字四邻域内,则玩家获胜;3次攻击次数使用完但是敌人仍然存活,则敌人获胜;本回合玩家没有使用攻击,但是敌人在本回合移动到玩家十字四邻域内,则敌人获胜。

文件下载

资源详情

[{"title":"( 55 个子文件 50.15MB ) 利用Socket编程完成小游戏功能(程序-详细代码+演示结果-小报告)","children":[{"title":"Socket编程","children":[{"title":"程序","children":[{"title":"Project3","children":[{"title":"Project3.sln <span style='color:#111;'> 2.14KB </span>","children":null,"spread":false},{"title":"Project3.vcxproj <span style='color:#111;'> 6.46KB </span>","children":null,"spread":false},{"title":".vs","children":[{"title":"Project3","children":[{"title":"v17","children":[{"title":"Browse.VC.db <span style='color:#111;'> 30.65MB </span>","children":null,"spread":false},{"title":"Solution.VC.db <span style='color:#111;'> 776.00KB </span>","children":null,"spread":false},{"title":".suo <span style='color:#111;'> 33.00KB </span>","children":null,"spread":false},{"title":"ipch","children":[{"title":"AutoPCH","children":[{"title":"d1f279ad527699a3","children":[{"title":"源.ipch <span style='color:#111;'> 48.81MB </span>","children":null,"spread":false}],"spread":true},{"title":"e8d970b21ad3368c","children":[{"title":"源.ipch <span style='color:#111;'> 48.81MB </span>","children":null,"spread":false}],"spread":false},{"title":"b2ce28535a6f41b3","children":[{"title":"源.ipch <span style='color:#111;'> 48.81MB </span>","children":null,"spread":false}],"spread":false},{"title":"6173510db343486c","children":[{"title":"源.ipch <span style='color:#111;'> 48.81MB </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"FileContentIndex","children":[{"title":"read.lock <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"6484da4b-f505-48a7-91d7-61170fe1bc3a.vsidx <span style='color:#111;'> 4.86KB </span>","children":null,"spread":false},{"title":"fdf9b8ff-282f-4ece-aa2e-7a08130dc685.vsidx <span style='color:#111;'> 11.78KB </span>","children":null,"spread":false},{"title":"077e2f1e-40b5-47f1-b4a8-76d63b3ea0cd.vsidx <span style='color:#111;'> 20.97KB </span>","children":null,"spread":false},{"title":"2021b535-3d56-4686-bdd7-5a444e712c06.vsidx <span style='color:#111;'> 8.48KB </span>","children":null,"spread":false},{"title":"merges","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"x64","children":[{"title":"Debug","children":[{"title":"vc143.pdb <span style='color:#111;'> 156.00KB </span>","children":null,"spread":false},{"title":"Project3.log <span style='color:#111;'> 265B </span>","children":null,"spread":false},{"title":"Project4.exe <span style='color:#111;'> 63.50KB </span>","children":null,"spread":false},{"title":"Project3.tlog","children":[{"title":"Project3.lastbuildstate <span style='color:#111;'> 181B </span>","children":null,"spread":false},{"title":"CL.write.1.tlog <span style='color:#111;'> 456B </span>","children":null,"spread":false},{"title":"Cl.items.tlog <span style='color:#111;'> 131B </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2.43KB </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 2.37KB </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 502B </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 19.09KB </span>","children":null,"spread":false}],"spread":true},{"title":"Project3.pdb <span style='color:#111;'> 1.14MB </span>","children":null,"spread":false},{"title":"Project4.pdb <span style='color:#111;'> 1.14MB </span>","children":null,"spread":false},{"title":"Project3.ilk <span style='color:#111;'> 660.23KB </span>","children":null,"spread":false},{"title":"vc143.idb <span style='color:#111;'> 411.00KB </span>","children":null,"spread":false},{"title":"Project3.vcxproj.FileListAbsolute.txt <span style='color:#111;'> 142B </span>","children":null,"spread":false},{"title":"源.obj <span style='color:#111;'> 61.90KB </span>","children":null,"spread":false},{"title":"Project3.exe.recipe <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"Project3.exe <span style='color:#111;'> 65.00KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"Project3.vcxproj.user <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"Project3.vcxproj.filters <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"源.cpp <span style='color:#111;'> 4.04KB </span>","children":null,"spread":false}],"spread":true},{"title":"Project4","children":[{"title":"Project4.vcxproj <span style='color:#111;'> 6.46KB </span>","children":null,"spread":false},{"title":"Project4.vcxproj.user <span style='color:#111;'> 168B </span>","children":null,"spread":false},{"title":"x64","children":[{"title":"Debug","children":[{"title":"vc143.pdb <span style='color:#111;'> 156.00KB </span>","children":null,"spread":false},{"title":"Project4.tlog","children":[{"title":"CL.write.1.tlog <span style='color:#111;'> 456B </span>","children":null,"spread":false},{"title":"Cl.items.tlog <span style='color:#111;'> 131B </span>","children":null,"spread":false},{"title":"Project4.lastbuildstate <span style='color:#111;'> 181B </span>","children":null,"spread":false},{"title":"CL.command.1.tlog <span style='color:#111;'> 1.36KB </span>","children":null,"spread":false},{"title":"link.command.1.tlog <span style='color:#111;'> 2.43KB </span>","children":null,"spread":false},{"title":"link.read.1.tlog <span style='color:#111;'> 2.75KB </span>","children":null,"spread":false},{"title":"link.write.1.tlog <span style='color:#111;'> 502B </span>","children":null,"spread":false},{"title":"CL.read.1.tlog <span style='color:#111;'> 19.09KB </span>","children":null,"spread":false}],"spread":true},{"title":"Project4.ilk <span style='color:#111;'> 639.88KB </span>","children":null,"spread":false},{"title":"Project4.log <span style='color:#111;'> 430B </span>","children":null,"spread":false},{"title":"Project4.exe.recipe <span style='color:#111;'> 317B </span>","children":null,"spread":false},{"title":"vc143.idb <span style='color:#111;'> 411.00KB </span>","children":null,"spread":false},{"title":"源.obj <span style='color:#111;'> 54.98KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Project4.vcxproj.filters <span style='color:#111;'> 965B </span>","children":null,"spread":false},{"title":"源.cpp <span style='color:#111;'> 2.18KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"计算机网络作业.docx <span style='color:#111;'> 90.74KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明