Merge 42a77d281e47bd0a9d9c1f4e8345812eccdc0270 into e8f95a4d4d7d3448a2984d39df4b70688e28ba54
7
Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
FROM nginx:1.10
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
COPY nginx.conf /etc/nginx
|
||||
RUN true
|
||||
VOLUME /mydata/nginx/conf:/etc/nginx
|
||||
VOLUME /mydata/nginx/html:/usr/share/nginx/html
|
||||
VOLUME /mydata/nginx/log:/var/log/nginx
|
32
README.md
@ -30,5 +30,37 @@
|
||||
3. 随机生成块:包括随机生成方块的图案和坐标。首先我根据全局参数计算出了总块数,然后用 shuffle 函数打乱存储所有动物图案的数组,再依次将数组中的图案填充到方块中。生成坐标的原理是随机选取坐标范围内的点,坐标范围可以随着层级的增加而递减,即生成的图案越来越挤,达到难度逐层加大的效果。
|
||||
4. 块的覆盖关系:怎么做到点击上层的块后,才能点下层的块呢?首先要给每个块指定一个层级属性。然后有两种思路,第 1 种是先逐层生成,然后每个格子里层级最高的块依次判断其周围格子有没有块层级大于它;第 2 种是在随机生成块的时候就给相互重叠的块绑定层级关系(即谁覆盖了我?我覆盖了谁?)。这里我选择了第 2 种方法,感觉效率会高一些。
|
||||
|
||||
## 启动命令
|
||||
|
||||
- 安装:yarn install
|
||||
- 本地启动:yarn dev
|
||||
- 构建:yarn build
|
||||
|
||||
## docker
|
||||
|
||||
### 打镜像目录
|
||||
|
||||

|
||||
|
||||
### 相关命令
|
||||
|
||||
- docker build -f Dockerfile -t yulegeyu .
|
||||

|
||||
- docker images
|
||||

|
||||
- docker run --name yulegeyu -p 8111:80 -d yulegeyu
|
||||

|
||||
|
||||
- 阿里云安全组放开8111端口
|
||||
|
||||

|
||||
|
||||
- 示例图
|
||||
|
||||

|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
BIN
doc/aliport.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
doc/build_docker_image_dir.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
BIN
doc/build_done.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
doc/building.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
doc/docker_run.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
doc/game1.png
Normal file
After Width: | Height: | Size: 232 KiB |
BIN
doc/game2.png
Normal file
After Width: | Height: | Size: 298 KiB |
45
nginx.conf
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|