From da2b1d9a6faaa19b7dbe7e378c3cfcf26aa12722 Mon Sep 17 00:00:00 2001 From: Catalin Constantin Mititiuc Date: Thu, 8 Jan 2026 11:05:20 -0800 Subject: [PATCH] WIP: on landing; on collision, color only local wall --- html/images/space.svg | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/html/images/space.svg b/html/images/space.svg index e41c303..fc8e0a4 100644 --- a/html/images/space.svg +++ b/html/images/space.svg @@ -745,7 +745,7 @@ function updateShip(s, elapsed) { // const baseSlope = slope(s.collision.edge); // if (Object.is(baseSlope, 0) && s.gearDown) s.isLanded = true; - s.isLanded = true; + // s.isLanded = true; let posP; if (s.collision.corner) { posP = cornerContactPosition(p.x, p.y, px, py, s.collision.corner, shipRadius); @@ -840,7 +840,7 @@ function init() { started = false; const mult = 10000; - s.position = { x: 0, y: 0 }; + s.position = { x: 10, y: 10 }; s.velocity = { x: 0, y: 0 }; // s. velocity = { x: 2*mult, y: 7*mult }; @@ -894,8 +894,7 @@ function animate(timestamp) { if (s.collision && !s.isLanded) { started = false; isReadingKeys = false; - wallElements.forEach(w => w.setAttribute('fill', 'red')); - // bg.style.fill = 'red'; + s.collision.wall.node.setAttribute('fill', 'red'); } if (restart) {