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