当前位置:网站首页>Graduation project - Design and development of restaurant management game based on unity (with source code, opening report, thesis, defense PPT, demonstration video and database)
Graduation project - Design and development of restaurant management game based on unity (with source code, opening report, thesis, defense PPT, demonstration video and database)
2022-06-28 18:58:00 【Programming ID】
be based on Unity The design and development of the restaurant management game
Download link :
Click me to download resources
One 、 land (Unity2020.3.3f1c1 edition )
Start interface
After entering the game , In the lower right corner of the start interface is a login button , When the player clicks the start button , Will enter the landing panel .

Login screen
The login panel is shown in the following figure , Players can choose to enter the user name and password to log in .
For login operation , On the client side , You need to monitor the user name and password entered by the player , The input format of players can be judged on the client , If the player's input format is incorrect, the player will be prompted to re input directly on the client , Otherwise, the data entered by the player will be packaged and sent to the server for processing . After the server receives the short message from the client , Resolve the user name and password entered by the player , The server will be in user Table , If it does not exist , Return the failure information to the client , If the search is successful , Will be in result Get the player's record in the table , Package the player's achievements and return them to the client . The client receives the response from the server , It will judge the returned message type , The returned results control whether the interface displays login success or failure . If the login is successful , The room list interface will be displayed .
Two 、 register
Registration page
The player selects the registration button to enter the registration interface for new user registration .
For registration operations , On the client side , You need to monitor the user name and password entered by the player , The input of players can be detected on the client , If the player's input is blank or the two passwords are not the same , Will directly remind the player to re-enter on the client , Otherwise, the data entered by the player will be packaged and sent to the server for processing . After the server receives the short message from the client , Resolve the user name and password entered by the player , And then in user Table , If the same name exists , Return the failure information to the client , Otherwise, in the user Add a new user in the table , Return success information to the client . The client receives the response from the server , The interface will be controlled according to the returned message UI Prompt that the registration is successful or failed .
Room management
Create a room
After landing successfully , Players will enter the room list interface , As shown in the figure below , On the left side of the room list is the personal information interface , Including players id、 The total number of games and the player's highest score . On the right is the list of rooms that can be added . Players can click the create room button in the lower right corner to create a room .
If you click the create room button , The client will send a request to the server to create a room . The server receives the request to create a room from the client , Will be in roomList Add a new... In the room list Room, And return the role type to the requesting client (RoleType = Chef1),Chef1 The role type indicates that the current client is the homeowner . After the client receives the successful response from the server to create a room , Will control the room panel to stack , And write the information of the current player into the room panel , The room panel of teammates shows waiting for players to join .
3、 ... and 、 Create a room waiting to join the interface
Join the room
Click the refresh button in the lower left corner , The room list on the right is refreshed , After refreshing, the room list on the right will get the currently existing rooms , Players can click the join button in any room in the room list to join .
Room list interface
After clicking the refresh button , The client will go through Request Class sends a request to the server for the current room list information . On the server , All the rooms are now Server Class , After receiving the request for room list from the client , The server will roomList The information is packaged and returned to the client . The client receives the room list information returned by the server , It will be parsed according to the rules of data packaging , Then write the parsed data to the room list panel , So that the current room list information is refreshed .
After clicking the room to be added , The client will send the player's click to the room's owner id Package and send to the server , Send a request to the server to join the room . The server receives the request to join the room from the client , Will be in roomList Transmitted by id Search for , If no room is found , The message that the room does not exist is returned to the client , Otherwise, add the client to the found room , And broadcast the news that players have joined to the homeowner , Let the client of the owner update the room information . At the same time, it will send back the response of successful joining to the client sending the room . After receiving the response after the server successfully joins the room , If the return is "join successfully..." , Will enter the room panel . The client of the owner receives a response from a player to join , The room page will be updated . Thus, both homeowners and non homeowners will display the room information panel with the same data . If a player clicks the exit room button , Then a request to exit the room will be sent to the server , After the server receives the exit request , Judge if the homeowner quits , Destroy the room directly ; If it is a non owner exit , Then remove the player from the player list of the room , After processing, the result is returned to the client for page update .
Room join success interface
After the player enters the room , After you click the start button , The game will enter 3 Second countdown , After the countdown , Players can control the movement of players through the up, down, left and right of the keyboard , Click the left mouse button to make dishes , After production , Dishes will be fired in the direction of mouse click , If the dishes arrive at the customer's table, they will score . If the player has completed the specified number of dishes , Then the game is over , The settlement panel will pop up .
After clicking the start button , The client will send a request to the server to start the game . After the server receives the request to start the game , First of all, we will judge whether the owner of the house sent the request to start the game , If not the owner , It will return the response information of failure to start the game to the client , conversely , If the owner , Will send a response to the start of the game to other players in the room , At the same time, send the successful response to the owner . The client receives the message returned by the server , If the return to start the game fails , Will prompt in the game interface “ You are not the owner , Unable to start the game !”. If you return to start the game successfully , Will enter the game interface . Other players in the room will also receive the broadcast message from the server to start the game , To enter the game interface . meanwhile , Generate players at the specified location . When entering the game interface , The game script attached to the camera will control the camera movement , Make the camera from UI Follow the player on the panel to focus on the current player , Keep the player in the center of the field of vision .
Wait for the owner to start the game interface
Server side CameController In executing the method of starting the game , While confirming that the owner starts the game , It will also open a 3 Second countdown , And send the countdown time value to all clients in the room . The client of the room receives the time value sent by the server , The obtained countdown value will be written into the countdown panel and displayed , So the players in the room will show 3 Second countdown , At the same time, the countdown sound effect is played when the countdown is displayed .
Start the game countdown interface
The service side in 3 After the second countdown , It will send a message to all clients in the room to start playing . After the client in the room receives the message to start playing , The client will add scripts to the current player to control the movement and make dishes , Thus, the player can control the player to move and make dishes through keyboard and mouse input . The client passes the lifecycle function in the script FixUpdate() Function to monitor the player's mobile input , When a player's mobile input is detected , In addition to controlling the current client's player movement , It will also send a request for player movement to the server , To forward the player's mobile information to another player in the room through the server , The client of another player controls the player's movement through the message sent by the server , So that the player can be seen moving on another client .
The player moves the scene
When the client detects that the player presses the left mouse button , Will use scripts to control players to make dishes , And play the corresponding sound effects , After production , The generated dishes will move in the direction the player clicked before . While controlling local players to make dishes , The client also sends a request to the server to make dishes , Transfer the local cooking information to the server , Send the information about the dishes made by the player to another player in the room through the server , The client of another player controls the dishes made by that player through the message sent by the server , So as to achieve the synchronization of all client-side dishes in the room .
Cooking scene
The prepared dishes are moving , It can detect the colliding objects , If a collision is detected with a customer , It means that the food is served successfully , Play score sound at the same time , At this point, the client will randomly generate (10, 20) Score in , Then send the score to the server for score processing , The server records that the total number of dishes served by the player meets the requirements , Will broadcast the end of the game to the room , And return the total score to the client , At the same time, the record table will be updated . The client receives the game end message from the server , The score sent by the server will be written into the score panel , And display it on the client .
Game settlement panel
Clicking the exit button in the game or clicking anywhere on the settlement panel will return to the room list panel . When entering the room list panel , The client updates the personal information panel on the left through the record data received from the server . As shown in the figure below .
Personal information update interface

The contents of the compressed package are as follows ( The download link is at the end of the article )

Download link : Click me to download resources
边栏推荐
- 实时Transformer:美团在单图像深度估计上的研究
- Brief introduction to mongodb working principle of mongodb series
- id门禁卡复制到手机_怎么把手机变成门禁卡 手机NFC复制门禁卡图文教程
- 数据资产为王,如何解析企业数字化转型与数据资产管理的关系?
- Analysis of the core components of mybayis
- openGauss内核:SQL解析过程分析
- Cvpr2022 | Zhejiang University and ant group put forward a hierarchical residual multi granularity classification network based on label relation tree to model hierarchical knowledge among multi granu
- 福建的朋友们,你们的养老保险上云啦!
- 解析机器人主持教学的实践发展
- devpi
猜你喜欢

模块化操作

leetcode 1423. Maximum Points You Can Obtain from Cards(从牌中能得到的最大点数和)

Yixin Huachen: real estate enterprises want to grasp the opportunity of the times for digital transformation

Business layer modification - reverse modification based on the existing framework

Lumiprobe 蛋白质标记研究方案

打破学科之间壁垒的STEAM教育

Mybayis之核心主件分析

Opengauss kernel: analysis of SQL parsing process

3D可旋转粒子矩阵

Steam education to break the barriers between disciplines
随机推荐
抗兔Dylight 488丨Abbkine通用型免疫荧光(IF)工具箱
Huawei cloud AOM released version 2.0, and three features appeared
1 goal, 3 fields, 6 factors and 9 links of digital transformation
About Critical Values
Native implementation Net5.0+ custom log
深入解析kubernetes中的选举机制
Seata implementation of sharing JDBC distributed transaction
使用.NetCore自带的后台作业,出入队简单模拟生产者消费者处理请求响应的数据
3D rotatable particle matrix
【Unity3D】发射(RayCast)物理射线(Ray)
Lumiprobe ProteOrange 蛋白质凝胶染料说明书
FFmpeg学习总结
WiFi安全漏洞KRACK深度解读
MindSpore系列一加载图像分类数据集
使用Karmada实现Helm应用的跨集群部署
几行代码就能实现复杂的 Excel 导入导出,这个工具类真心强大!
牛津大學教授Michael Wooldridge:AI社區近40年如何看待神經網絡
Pipeline based hybrid rendering
Summary of the use of qobjectcleanuphandler in QT
Operations research note