summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2024-07-06 22:10:00 -0500
committersanine <sanine.not@pm.me>2024-07-06 22:10:00 -0500
commit909a3c49fb48361b65dceb437b4182380d3b8277 (patch)
treeb3cb9ede70e682183e200652593cb219da0973f1
parentc012fec2870757990080e823d42dd91031e64f25 (diff)
add more levels
-rw-r--r--levelSelect.js8
-rw-r--r--render.js2
2 files changed, 7 insertions, 3 deletions
diff --git a/levelSelect.js b/levelSelect.js
index 238639c..30285e7 100644
--- a/levelSelect.js
+++ b/levelSelect.js
@@ -19,6 +19,10 @@ const levels = {
['parabolic 0'],
buildLevel(t => -0.5*(t-3)**2 + 4, t => t-3, [...Array(8).keys()].map(x => x - 2)),
],
+ 'logarithmic': [
+ ['parabolic 0'],
+ buildLevel(t => t-3, t => 4*Math.log(t), [...Array(8).keys()].map(x => x - 2)),
+ ],
'orbital': [
['parabolic 0', 'sinusoidal'],
buildLevel(t => 8*Math.cos(t), t => 8*Math.sin(t), [...Array(8).keys()].map(x => Math.PI * x / 4)),
@@ -39,8 +43,8 @@ export function setupLevelSelectUi(root, sfx) {
const levelPicker = name => {
const [ dependencies, level ] = levels[name];
const allDependenciesSatisfied = dependencies.map(x => levels[x][1].completed).reduce((acc, x) => acc && x, true);
- // if (allDependenciesSatisfied) {
- if (true) {
+ if (allDependenciesSatisfied) {
+ // if (true) {
const button = document.createElement('input');
button.type = 'button';
button.value = name;
diff --git a/render.js b/render.js
index 126d6be..ce31973 100644
--- a/render.js
+++ b/render.js
@@ -29,7 +29,7 @@ export function drawShip(ctx, pos, angle) {
ctx.translate(x, y);
ctx.rotate(angle);
ctx.fillStyle = 'white';
- const STEP = 0.2;
+ const STEP = 0.4;
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(-STEP, -STEP);