From f7a22ed8a605d15ba95752517fab411fede9b62c Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Mon, 10 Apr 2023 11:23:06 +0200 Subject: [PATCH] cleanup --- index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index c3af4a9..74fe764 100644 --- a/index.html +++ b/index.html @@ -2964,14 +2964,12 @@ AFRAME.registerComponent('collider-check', { let c = e.detail.els[0].cloneNode() AFRAME.scenes[0].appendChild(c) let pos = e.detail.els[0].getAttribute("position").clone() -console.log("found at", pos) -let rig = document.getElementById("rig").getAttribute("position") -if ( rig.distanceTo( pos ) == 0 ) rig.y++ // TODO doesn't work if the player itself moved + let rig = document.getElementById("rig").getAttribute("position") + if ( rig.distanceTo( pos ) == 0 ) rig.y++ // TODO doesn't work if the player itself moved pos.y = Array.from( document.querySelectorAll(".cubes") ) .filter( c => (c.getAttribute("position").x == pos.x && c.getAttribute("position").z == pos.z ) ) .sort( (b,a) => a.getAttribute("position").y - b.getAttribute("position").y )[0] .getAttribute("position").y + 1 -console.log("adding at", pos) c.setAttribute("position", AFRAME.utils.coordinates.stringify( pos) ) c.setAttribute("material", "wireframe:true") c.classList.add("cubes") @@ -3026,7 +3024,11 @@ AFRAME.registerComponent('startfunctions', { + + + + @@ -3036,8 +3038,6 @@ AFRAME.registerComponent('startfunctions', { - -