Design and Implementation of Backgammon Based on Python (Paper + Source Code)_kaic

Contents Abstract Introduction
1. Analysis of game requirements (1) Game design goals (2) Functional requirements of the game 1. Visualization module 2. Player operation module 3. Victory determination module (3) Performance requirements of the game (4) Other requirements of the game 2. Feasibility study of backgammon game development (1) Economic feasibility study (2) Social feasibility study 3. Structural system analysis of backgammon game (1) Game design process analysis (2) Game system design structure analysis 4. Game realization Specific algorithm analysis (1) Reference to tkinker library (2) for loop (3) canvas component 5. Detailed design of the game and main interface display (1) Main interface of the game (2) Interface after the player wins 6. System test (1) Test purpose (2) Test plan (3) Test process 7. Problems encountered and solutions Summary References




























Abstract
The design and implementation of this Python-based backgammon game is developed using the Pygame module and some other modules. The chessboard is set to 15-way, which is the size of the international standard board. The main functions and interface are divided into three parts, namely the visualization module and the player Composed of an operation module and a win-lose judgment module, various Button boxes are set to prompt the next step, start the game, the first player, the winner of the game, and the new game.
The program has a clear interface, reasonable game rules, stable running effect and good user interaction. Through the analysis of the experimental results, it is proved that the program can simulate the normal backgammon game process and has high playability. This thesis demonstrates the practical application of Python language in game programming through the design and implementation of a Gobang program based on Python. At the same time, it also provides some reference and reference for the future development in the field of game programming.


【Keywords】Python, Pygame, Button prompt box 

1. Game requirements analysis
(1) Game design goals
     The main goal of this game design is to facilitate the limitations of traditional chessboards on the venue and the crowd. Usually, the use of backgammon needs to be used in conjunction with chess pieces and chessboards. In order to facilitate the use of the crowd and quickly Backgammon battles, design software games for convenient games. [1] The specific goal of game design is to design a standard backgammon graphic chessboard, which can be used to move the mouse smoothly. After the move, determine the player who will make the next move. After the game is over, determine the winner, and use the prompt box to prompt the winner and whether to start In the next game, functions such as repentance, admit defeat, and exit can be realized through related buttons, making the display of functions more intuitive and clear, and more friendly to user groups of all ages.
Therefore, the development of this backgammon game has many advantages such as low cost, limited user groups, simple and clear functional modules, and convenient operation. Relying on online game competition in the network environment, gradually expand the scale of users and increase the number of game users, so as to facilitate the healthy development of commercialization in the future.
(2) The functional requirements of the game
    Based on the investigation and interview of the current game market and the analysis of the audience, the functional requirements and development needs of the backgammon game design are basically divided into three modules, the visualization module, the player operation module, and the outcome determination For the three parts of the module, Alibaba Cloud servers can be rented for online deployment to ensure the situation when the number of users is small in the early stage. Later, the size of the server is determined according to the number of users to ensure the normal operation of the game.
1. Visualization module
The design of the visualization module is mainly divided into window interface design and chessboard design. Design a simple and beautiful window to avoid affecting the user’s subjective judgment and operation of the game when using the game. Design a standardized chessboard to make the game and the line as simple as possible. The effect of using below is similar.
2. Player operation module
The player operation module is mainly composed of three parts: move, regret, and admit defeat. After the move, the player cannot cancel the move, remind the opponent to make the move, set the specified time for the move, and remind after the timeout. The opponent player agrees, and only when he agrees can he regret the game. If he finds that his game is about to fail or cannot be reversed, he can admit defeat in advance to save time for both parties.
3. Outcome Judgment Module
The Outcome Judgment Module is mainly divided into judging a tie and judging the victory of the black and white side. In the case of a tie, it is necessary to place a piece on any position of the chessboard and there will be no victory or no place to place a piece. When judging the outcome, which side has five pieces on one line and which side victory.

(3) Performance requirements of the game
  The design of this backgammon game first needs to meet the stability design. Even if multiple people are online at the same time, the game must be able to run smoothly without causing game crashes, black screens, flashbacks, etc. Even if the above situations occur You can also quickly locate the problem code and modify it to improve user satisfaction and facilitate the smooth progress of the game.
(4) Other requirements of the game
  Due to the restrictions of national laws and regulations, real-name authentication is also required for backgammon games. Therefore, it is necessary to set up a database to ensure that the contents of the database are not leaked, and at the same time perform real-name authentication comparisons. If you are a minor, you need to set the game duration according to the law, because Personal privacy issues are designed, so user data must be securely encapsulated to avoid data confusion and redundancy, maintain the independence of user data, and ensure the security and tightness of data information. [1]
2. Feasibility study of backgammon game development
(1) Economic feasibility study
As backgammon game development is relatively simple, only one developer can complete the entire development, follow-up maintenance is also more convenient, and the required economic cost is also relatively Limited, the size of the server is mainly determined according to the number of user groups. If there are many game groups, you can choose to expand the server. This game design can improve the spread and use of traditional games. The subsequent economic effects can be accessed through the corresponding advertisements through the number of user groups. Maintain game costs and labor costs, avoid labor waste, and have certain social and practical benefits.
(2) Social Feasibility Research
At present, the number of Internet groups is increasing, and the number of online game users is also increasing. The operation of this game is relatively simple, and it is not difficult for different groups to get started. It is suitable for most people and uses Python. Software development, use the Pygame module to develop games, the development is more convenient, you only need to follow the interface prompts to complete the use of all functions, there will be no unclear use process, incomplete user experience, if this game needs to be put on the shelves, you need to understand the privacy agreement in advance , communicate with relevant staff on how to access the privacy interface protocol, and protect user privacy information reasonably and legally.
According to the economic feasibility study and social feasibility analysis, using the backgammon game group environment, the design of this game design system is technically feasible, economically reasonable, and in line with market laws, regulations and policies, and the game can be developed.

 

 

Guess you like

Origin blog.csdn.net/weixin_39563171/article/details/131101539