From 7d97132aa19936fb68dd5e43251f4bb5d28f9930 Mon Sep 17 00:00:00 2001
From: Nathan DECHER
Date: Tue, 14 Apr 2020 16:26:22 +0200
Subject: [PATCH 1/4] progressbar, centered percentage
---
src/js/progress.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/js/progress.js b/src/js/progress.js
index 973f0bc..0c33ad3 100644
--- a/src/js/progress.js
+++ b/src/js/progress.js
@@ -34,7 +34,7 @@ class ProgressBar {
ctx.fillRect(0, 0, canvas.width*this.completeCount/this.taskCount, canvas.height);
ctx.fillStyle=textColor;
ctx.textAlign='center';
- ctx.textBaseline='center';
+ ctx.textBaseline='middle';
ctx.font=`${canvas.height/2}px 'Fira Code'`;
ctx.fillText(this.percent+'%', canvas.width/2, canvas.height/2);
}
From bbb34e63b689ce0b5141e6325b7f436bca715a99 Mon Sep 17 00:00:00 2001
From: Nathan DECHER
Date: Tue, 14 Apr 2020 16:26:47 +0200
Subject: [PATCH 2/4] configEditor, only show keys in debug mode
---
assets/config.json | 2 ++
src/js/configEditor.js | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/assets/config.json b/assets/config.json
index 09c1aba..0dd4800 100644
--- a/assets/config.json
+++ b/assets/config.json
@@ -1,4 +1,6 @@
{
+ "debug": false,
+
"player.name": "Player",
"player.leaderboards": false,
diff --git a/src/js/configEditor.js b/src/js/configEditor.js
index fc9baed..6d40ea1 100644
--- a/src/js/configEditor.js
+++ b/src/js/configEditor.js
@@ -22,7 +22,7 @@ class ConfigEditor extends Popup {
let id='cfgInput-'+(lastCEId++)+'-'+key.replace(/\./g, '-');
let label=span.appendChild(document.createElement('label'));
label.innerText=data.name;
- label.title=key;
+ if(config.getB('debug')) label.title=key;
let input;
if(data.type=='boolean') {
From 3d50bf805d6af7af442373a564f3dc1916aa8324 Mon Sep 17 00:00:00 2001
From: Nathan DECHER
Date: Tue, 14 Apr 2020 16:31:11 +0200
Subject: [PATCH 3/4] configEditor, explain why input is disabled
---
src/js/configEditor.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/js/configEditor.js b/src/js/configEditor.js
index 6d40ea1..377f995 100644
--- a/src/js/configEditor.js
+++ b/src/js/configEditor.js
@@ -67,7 +67,7 @@ class ConfigEditor extends Popup {
input.disabled=
data.excludes
.some(key => config.getB(key));
- input.title=input.disabled?`Disable ${data.excludes.join(',')} to enable`:'';
+ input.title=input.disabled?`Disable '${data.excludes.map(k => metaConfig[k].name).join('\', \'')}' to enable`:'';
};
setEnabled();
@@ -78,7 +78,7 @@ class ConfigEditor extends Popup {
} else if(data.parent) {
const setEnabled=() => {
input.disabled=!config.getB(data.parent);
- input.title=input.disabled?`Enable ${data.parent} to enable`:'';
+ input.title=input.disabled?`Enable '${metaConfig[data.parent].name}' to enable`:'';
};
setEnabled();
From 7b20b0e8ec76d3873906afd54320d77d3249e07d Mon Sep 17 00:00:00 2001
From: Nathan DECHER
Date: Tue, 14 Apr 2020 16:41:08 +0200
Subject: [PATCH 4/4] updated help
---
public/help.html | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/public/help.html b/public/help.html
index 39bb8df..34d040f 100644
--- a/public/help.html
+++ b/public/help.html
@@ -47,6 +47,22 @@
A timed game only lasts for 30 seconds, and the goal is to get as high a score as possible.
+
+ Survival
+
+ In survival mode, the playfield doesn't loop, fruits don't spawn, and you can't win.
+ This modes get progressively harder, with speed increases, and snake growth.
+ At first, this process is slow, but it gets faster with time.
+
+
+
+ Puzzle mode
+
+ In puzzle mode, time doesn't flow until you move.
+ Weird tiles make their debut, like portals, keys, etc.
+ Your goal is to get the fruits in as little moves as you can.
+
+
Tiles
@@ -58,6 +74,8 @@
Oil is flammable and will periodically catch on fire, which will kill you. It is otherwise perfectly safe
Super fruits give you 10 points, and sometimes spawn in arcade mode
Decaying fruits give you 5 points and sometimes spawn in arcade mode, but they also decay after 2 seconds and disappear
+ Portals teleport you to the corresponding portal
+ Keys make Doors disappear