Fix indent
This commit is contained in:
@@ -293,12 +293,8 @@
|
|||||||
console.log("corners on map", mapCorners);
|
console.log("corners on map", mapCorners);
|
||||||
console.log("edges on map", mapEdges);
|
console.log("edges on map", mapEdges);
|
||||||
|
|
||||||
const allEdgePts = allWallCorners.map(w =>
|
|
||||||
w.map((pt, i, arr) => [pt, arr[(i + 1) % arr.length]])
|
|
||||||
);
|
|
||||||
|
|
||||||
let allStartingEdges;
|
let allStartingEdges;
|
||||||
init(allEdgePts);
|
init();
|
||||||
|
|
||||||
function distance(x1, y1, x2, y2) {
|
function distance(x1, y1, x2, y2) {
|
||||||
return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
|
return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
|
||||||
@@ -449,8 +445,8 @@
|
|||||||
const delim = ' ';
|
const delim = ' ';
|
||||||
const className = 'clockwise-orientation';
|
const className = 'clockwise-orientation';
|
||||||
|
|
||||||
if (!triangleContainer.childElementCount)
|
// if (!triangleContainer.childElementCount)
|
||||||
drawTriangles(triangleContainer, allEdgePts, position);
|
// drawTriangles(triangleContainer, allEdgePts, position);
|
||||||
|
|
||||||
const triangles = triangleContainer.querySelectorAll('polygon');
|
const triangles = triangleContainer.querySelectorAll('polygon');
|
||||||
|
|
||||||
@@ -814,7 +810,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateEdges(position) {
|
function updateEdges(position) {
|
||||||
const collisionEdges = findAllEdges(allEdgePts, position);
|
// const collisionEdges = findAllEdges(allEdgePts, position);
|
||||||
|
const collisionEdges = [];
|
||||||
|
|
||||||
[...edgeContainer.children].forEach(l => {
|
[...edgeContainer.children].forEach(l => {
|
||||||
const x1 = l.getAttribute('x1');
|
const x1 = l.getAttribute('x1');
|
||||||
@@ -879,7 +876,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function init(edgePts) {
|
function init() {
|
||||||
started = false;
|
started = false;
|
||||||
const mult = 10000;
|
const mult = 10000;
|
||||||
|
|
||||||
@@ -947,7 +944,7 @@
|
|||||||
if (restart) {
|
if (restart) {
|
||||||
started = false;
|
started = false;
|
||||||
restart = false;
|
restart = false;
|
||||||
init(allEdgePts);
|
init();
|
||||||
time.innerText = 0;
|
time.innerText = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1045,7 +1042,7 @@
|
|||||||
break;
|
break;
|
||||||
case "KeyR":
|
case "KeyR":
|
||||||
isReadingKeys = true;
|
isReadingKeys = true;
|
||||||
!started ? init(allEdgePts) : restart = true;
|
!started ? init() : restart = true;
|
||||||
break;
|
break;
|
||||||
case "KeyW":
|
case "KeyW":
|
||||||
case "ArrowUp":
|
case "ArrowUp":
|
||||||
@@ -1110,7 +1107,6 @@
|
|||||||
yp.innerText = Math.trunc(svgP.y);
|
yp.innerText = Math.trunc(svgP.y);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//]]></script>
|
//]]></script>
|
||||||
</svg>
|
</svg>
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 34 KiB |
Reference in New Issue
Block a user