[Fun open source project] Linux system deployment jump jump classic game
1. Introduction to the jump game
1.1 Introduction to the Jump Game
Jump is a very popular casual game. The gameplay is very simple. Players only need to control a villain to cross various obstacles by jumping to get the highest score possible. This practice aims to complete the deployment of the Jump Jump mini game open source version project.
1.2 Project address
gitee address: https://gitee.com/fwjzzz/Jump
- Trial address: https://fwjzzz.gitee.io/jump
2. Introduction to this practice
2.1 Local environment planning
This practice is a personal test environment, and the operating system version is centos7.6.
hostname | IP address | Operating system version | Kernel version |
---|---|---|---|
jeven | 192.168.3.166 | centos 7.6 | 3.10.0-957.el7.x86_64 |
2.2 Introduction to this practice
1. This practice environment is a personal test environment, please be cautious in the production environment;
2. Deploy the classic mini game of Jump to Jump in the centos7.6 environment.
3. Install httpd software
3.1 Check the yum repository
If there is no mirror source, you can use Alibaba Cloud's mirror source.
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sed -i -e '/mirrors.cloud.aliyuncs.com/d' -e '/mirrors.aliyuncs.com/d' /etc/yum.repos.d/CentOS-Base.repo
Check the status of the yum warehouse to ensure that each mirror source is normal.
[root@jeven ~]# yum repolist enabled
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
* epel: mirrors.bestthaihost.com
repo id repo name status
!base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 10,072
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 13,767
!extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 518
!mongodb-org MongoDB Repository 342
!mysql-connectors-community/x86_64 MySQL Connectors Community 227
!mysql-tools-community/x86_64 MySQL Tools Community 100
!mysql57-community/x86_64 MySQL 5.7 Community Server 678
!updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 5,176
repolist: 30,880
3.2 Install httpd software
Use yum directly to install the httpd software.
yum -y install httpd
3.3 Start httpd service
Start the httpd service and enable it to start automatically at boot.
systemctl start httpd && systemctl enable httpd
3.4 View httpd service
Check the httpd service status to ensure that the httpd service is normal.
[root@jeven ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-10-18 06:37:57 CST; 8h ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 23044 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Main PID: 23050 (httpd)
Status: "Total requests: 4; Current requests/sec: 0; Current traffic: 0 B/sec"
Tasks: 9
Memory: 3.6M
CGroup: /system.slice/httpd.service
├─23050 /usr/sbin/httpd -DFOREGROUND
├─23051 /usr/sbin/httpd -DFOREGROUND
├─23052 /usr/sbin/httpd -DFOREGROUND
├─23053 /usr/sbin/httpd -DFOREGROUND
├─23054 /usr/sbin/httpd -DFOREGROUND
├─23055 /usr/sbin/httpd -DFOREGROUND
├─23059 /usr/sbin/httpd -DFOREGROUND
├─23060 /usr/sbin/httpd -DFOREGROUND
└─23061 /usr/sbin/httpd -DFOREGROUND
Oct 18 06:37:57 jeven systemd[1]: Starting The Apache HTTP Server...
Oct 18 06:37:57 jeven systemd[1]: Started The Apache HTTP Server.
3.5 Firewall and selinux settings
- Set up selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
- Turn off the firewall. If you want to turn on the firewall, you need to allow port 80.
systemctl stop firewalld && systemctl disable firewalld
3.6 Browser testing web services
Open the browser: http://192.168.3.166 and replace the IP with your own server IP address.
4. Deploy the classic mini-game of Jump and Jump
4.1 Download the jump game source code
Enter the root directory of the web page
[root@jeven ~]# cd /var/www/html/
[root@jeven html]#
Pull the jump game source code from gitee
git clone https://gitee.com/fwjzzz/Jump.git
4.2 Restart the httpd service
Restart httpd service
systemctl restart httpd
4.3 Access the jump mini game web page
Access address: http://server IP address/Jump, enter the Jump Jump classic mini-game webpage in the browser.
5. Try the classic mini game of Jump and Jump
Game play is as follows:
-
After the game starts, the player needs to use the mouse to click anywhere on the screen, and the small black block will start to jump. If the jump is not far enough or too far, it will fall and the game will end.
-
In the game, if you hold down the left mouse button, the small black block will begin to compress. Release the left mouse button and the small black block will jump.
-
The longer you hold down the left button of the mouse, the farther the small black block jumps. You need to control the jumping strength to jump to the white block.
-
Bottoming out or jumping inaccurately will cause the game to fail and restart.
-
Each time a player successfully jumps to a white square, the player gets 1 point.
-
The game design is simple, the graphics are fresh and cute, the operation is simple and easy to use, and it is suitable for all people to play.