当前位置>主页 > 期刊在线 > 计算机技术 >

计算机技术2018年11期

斗地主游戏的设计与实现
赵娟,弋改珍
(咸阳师范学院 计算机学院,陕西 咸阳 712000)

摘  要:斗地主游戏系统开发使用的是C++ 语言,系统使用了C/S 架构。本系统建立在局域网之上,主要就是建立一个服务器用来存储数据,然后通过服务器和客户端之间的通信来实现游戏过程。此游戏系统主要包括建立服务器、建立客户端与服务器的链接、定义纸牌、发牌、抢地主、出牌、纸牌大小比较等功能。其中利用网络编程相关知识,实现三次握手四次挥手,同 时还可以解决客户端与服务器之间的链接问题。实现定义纸牌模块与发牌、抢地主模块,通过定义一个K 值,取1-54 的数字代表整副纸牌,然后加入TYPE、NUM 等变量解决出牌和纸牌牌面大小比较算法。由于受时间及技术娴熟程度的限制,其功能有待进一步完善;但游戏画面简洁明了,可进行傻瓜式操作,具有可玩性较高,流畅度高的优势。


关键词:C++;桌面游戏;斗地主游戏



中图分类号:TP317         文献标识码:A         文章编号:2096-4706(2018)11-0081-03


The Design and Implementation of the Game of the Bucket Landlord

ZHAO Juan,YI Gaizhen

(School of Computer Science,Xianyang Normal University,Xianyang 712000,China)

Abstract:The Landlords game system is developed using the C++ language,and the system uses the C/S architecture. The systemis based on LAN,mainly to establish a server to store data,and then through the communication between the server and the client toachieve the game process. The game system mainly includes the establishment of servers,the establishment of client-server links,thedefinition of cards,licensing,landlords,cards,card size comparison and other functions. The network programming knowledge is usedto realize three handshakes and four waving,and the problem of link between client and server can be solved. Realize the definition ofcard module and licensing,landlord robbery module,through the definition of a K value,take 1-54 digital representation of the wholedeck of cards,and then add TYPE,NUM and other variables to solve the card and card size comparison algorithm. Due to the limitationsof time and technical proficiency,its function needs to be further improved,but the game screen is concise and clear,can be foolishoperation,with high playability,high fluency advantages.

Keywords:C++;table games;bucket landlords game


参考文献:

[1] 潘正辉. 基于Android 系统手机游戏的设计与开发研究 [J]. 电子世界,2016(13):128+130.

[2] 李竹林. 基于Android 系统的斗地主游戏的设计与实现 [J]. 河南科学,2015,33(2):200-203.


作者简介:赵娟(1975-),女,汉族,四川成都人,教师,讲师,硕士研究生,研究方向:软件工程。