【好玩的开源项目】Linux系统之部署adarkroom文字风格冒险小游戏

一、adarkroom小游戏介绍

1.1 adarkroom小游戏简介

《adarkroom》是一款文字风格的冒险游戏,玩家需要在黑暗的房间里生存和探索,通过制作工具、建造建筑和采集资源来提高生存能力。游戏的画面简单,但是玩法深入,需要玩家耐心地发掘和探究。游戏逐渐升级,包括建造更高级的建筑物、招募更多居民、探索更广阔的地图等等,提供了丰富的游戏体验。游戏的难度逐渐增加,需要玩家探索和应对各种挑战,提高自己的智慧和技能。总体来说,这是一款非常有趣的文字冒险游戏,适合喜欢探索和挑战的玩家尝试。

1.2 项目地址

Github地址 :https://github.com/doublespeakgames/adarkroom

在这里插入图片描述

二、本次实践介绍

2.1 本地环境规划

本次实践为个人测试环境,操作系统版本为centos7.6。

hostname IP地址 操作系统版本 内核版本
jeven 192.168.3.166 centos 7.6 3.10.0-957.el7.x86_64

2.2 本次实践介绍

1.本次实践环境为个人测试环境,生产环境请谨慎;
2.在centos7.6环境下部署adarkroom文字风格冒险小游戏。

三、安装httpd软件

3.1 检查yum仓库

如果没有镜像源,可以使用阿里云的镜像源。

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

检查yum仓库状态,确保各镜像源正常。

[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 安装httpd软件

直接使用yum安装httpd软件。

yum -y install  httpd

在这里插入图片描述

3.3 启动httpd服务

启动httpd服务,并使开机自启。

systemctl start httpd && systemctl enable  httpd

3.4 查看httpd服务

查看httpd服务状态,确保httpd服务正常。

[root@jeven html]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2023-11-04 11:58:30 CST; 1 weeks 0 days ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 48980 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 37556 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
    Tasks: 11
   Memory: 4.2M
   CGroup: /system.slice/httpd.service
           ├─37556 /usr/sbin/httpd -DFOREGROUND
           ├─48996 /usr/sbin/httpd -DFOREGROUND
           ├─48997 /usr/sbin/httpd -DFOREGROUND
           ├─48998 /usr/sbin/httpd -DFOREGROUND
           ├─48999 /usr/sbin/httpd -DFOREGROUND
           ├─49000 /usr/sbin/httpd -DFOREGROUND
           ├─55302 /usr/sbin/httpd -DFOREGROUND
           ├─67593 /usr/sbin/httpd -DFOREGROUND
           ├─67594 /usr/sbin/httpd -DFOREGROUND
           ├─67595 /usr/sbin/httpd -DFOREGROUND
           └─67596 /usr/sbin/httpd -DFOREGROUND

Nov 04 11:58:30 jeven systemd[1]: Starting The Apache HTTP Server...
Nov 04 11:58:30 jeven systemd[1]: Started The Apache HTTP Server.
Nov 05 10:22:01 jeven systemd[1]: Reloading The Apache HTTP Server.
Nov 05 10:22:01 jeven systemd[1]: Reloaded The Apache HTTP Server.

3.5 防火墙和selinux设置

  • 设置selinux
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
setenforce 0
  • 关闭防火墙,如果想要开启防火墙,需放行80端口。
systemctl stop firewalld && systemctl disable firewalld

3.6 浏览器测试web服务

浏览器打开:http://192.168.3.166,将IP替换为自己服务器IP地址。

在这里插入图片描述

四、部署adarkroom文字风格冒险小游戏

4.1 下载小游戏源码

进入网页根目录

[root@jeven ~]# cd /var/www/html/
[root@jeven html]#

在github拉取adarkroom小游戏源码

 git clone https://github.com/doublespeakgames/adarkroom.git

在这里插入图片描述

4.2 查看项目源码目录

查看项目源码目录

[root@jeven html]# tree -L 1 ./adarkroom
./adarkroom
├── audio
├── browserWarning.html
├── contributing.md
├── css
├── dev-server.js
├── doc
├── favicon.ico
├── img
├── index.html
├── lang
├── lib
├── LICENSE.md
├── mobileWarning.html
├── package.json
├── README.md
├── script
├── tools
└── yarn.lock

8 directories, 10 files

4.3 重启httpd服务

重启httpd服务

systemctl restart httpd

4.4 访问小游戏web页面

访问地址:http://服务器IP地址/ adarkroom,在浏览器进入adarkroom文字风格冒险小游戏页面。

在这里插入图片描述

五、试玩adarkroom文字风格冒险小游戏

5.1 设置游戏语言

在页面的右下角,选择“language”,设置语言为简体中文。

在这里插入图片描述
在这里插入图片描述

5.2 关闭/开启游戏声音

在右下角,设置sound on/sound off来开启关闭游戏声音。

在这里插入图片描述

5.3 设置夜间模式

点击右下角的“夜间模式”,背景被调整为夜间。

在这里插入图片描述

5.4 试玩游戏

通过页面提示,可以试玩adarkroom文字风格冒险小游戏。

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/jks212454/article/details/134351800