1、 毕 业 设 计 说 明 书 学生姓名学生姓名 学学 号号 学院学院 计算机科学与技术学院 专专 业业 软件工程 题题 目目 基于 MFC 的 对战象棋设计与实现 指导教师指导教师 (姓 名) (专业技术职称/学位) 年 月 毕业论文独创性声明 本人郑重声明: 本论文是我个人在导师指导下进行的研究工作及取得的研究成果。本论 文除引文外所有实验、数据和有关材料均是真实的。尽我所知,除了文中特 别加以标注和致谢的地方外,论文中不包含其他人已经发表或撰写过的研究 成果。其他同志对本研究所做的任何贡献均已在论文中作了明确的说明并表 示了谢意。 作者签名: 日 期: 1 摘摘 要:要:中国象棋是我国历史
2、悠久的智力对战游戏,发展至今已有数千年的历史,是中华 民族智慧的结晶。然而,传统象棋存在着棋盘单一、棋子收拾繁琐、下棋场地单一、无法 及时找到对弈玩家几大弊端。随着计算机技术的发展,电子版象棋游戏的诞生,很好的解 决了这些问题。 本设计正是开发这样一款电子象棋游戏, 它采用 MFC 文档视图体系结构和 Visual C+ 开发工具,实现了具有背景棋盘和棋子种类的变换,走棋,悔棋,还原和网络对弈功能。 本设计还进行了画面闪烁消除,视觉效果更加人性化,且鼠标操作,简单易用,无须安装, 即开即用。 关键词:关键词:中国象棋,MFC 文档视图,Visual C+,网络对弈,消除闪烁,即开即用 2 Ab
3、stract:Chinese Chess is our long history of intellectual battle game, the development has several thousand years of history, is the crystallization of the wisdom of the Chinese nation. However, the traditional chess there is a single board, the pieces pack cumbersome, chess venues single, not been a
4、ble to find several major drawbacks of the chess players. With the development of computer technology, the electronic version of the birth of a chess game, a good solution to these problems. The design is the development of an electronic chess game, which uses MFC document view architecture and Visu
5、al C + + development tools, background board and pieces kind of transformation, playing chess, undo, restore, and network chess function. This design also flickering eliminate, visual effects, more human, mouse operation, easy to use, no need to install. Keywords:Chinese chess, MFC document view, Vi
6、sual C+, network game, eliminate flicker, instant available 3 目目 录录 1 绪论 . 4 1.1 课题背景. 4 1.2 象棋简介. 4 1.3 MFC 及相关技术 6 2 概要设计 . 9 2.1 设计思路分析 . 9 2.2 主要功能. 9 2.3 软件信息. 10 2.4 流程图 10 3 程序详细设计说明. 12 3.1 界面设计. 12 3.2 数据结构. 15 3.3 棋子走法. 18 3.3.1 車 . 19 3.3.2 馬 . 20 3.3.3 相(象) 21 3.3.4 仕(士) 22 3.3.5 帅(将) 23 3.3.6 炮(砲) 24 3.3.7 兵(卒) 25 3.4 功能 26 3.4.1 走棋 . 26 3.4.2 悔棋 . 29 3.4.3 还原 . 30 3.4.4 认输 . 31 3.4.5 摆棋 . 31 3.5 网络 31 3.6 关键技术. 34 3.6.1 遮罩技术 34 3.6.2 双缓冲技术 34 4 总结和进一