This commit is contained in:
2026-03-31 17:51:18 +02:00
parent 6a5774667e
commit 2eb0e64b30
5 changed files with 60 additions and 20 deletions

View File

@@ -258,6 +258,15 @@ main {
background-position: center; background-position: center;
} }
.captor-vertical-top {
background-color: #DADEEF;
background-image: url("/web/assets/img/tiles/Capteur-1.svg");
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
transform: rotate(90deg);
}
.cable { .cable {
background-color: #DADEEF; background-color: #DADEEF;
background-image: url("/web/assets/img/tiles/CableH.svg"); background-image: url("/web/assets/img/tiles/CableH.svg");
@@ -274,6 +283,14 @@ main {
background-position: center; background-position: center;
} }
.cable-turn-horizontale3 {
background-color: #DADEEF;
background-image: url("/web/assets/img/tiles/CableTopRight.svg");
background-size: 100%;
background-repeat: no-repeat;
background-position: center;
}
.cable-vertical { .cable-vertical {
background-color: #DADEEF; background-color: #DADEEF;
background-image: url("/web/assets/img/tiles/CableV.svg"); background-image: url("/web/assets/img/tiles/CableV.svg");

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 520 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -24,10 +24,12 @@ const legend = {
rotatorButton: 20, rotatorButton: 20,
cableTurn: 21, cableTurn: 21,
horizontalSemi: 22, horizontalSemi: 22,
cableTurnHorizontale : 23, cableTurnHorizontale: 23,
cableTurnHorizontale2 : 24, cableTurnHorizontale2: 24,
captorTurnHorizontal : 25, captorTurnHorizontal: 25,
wallSemiAngle: 26, wallSemiAngle: 26,
cableTurnHorizontale3: 27,
captorVerticalTop: 28
}; };
const laserColors = { const laserColors = {
@@ -50,7 +52,7 @@ const glassOptions = [
], ],
[ [
{ color: laserColors.red, maxAmount: 1, currentAmount: 1 }, { color: laserColors.red, maxAmount: 1, currentAmount: 1 },
{ color: laserColors.blue, maxAmount: 2, currentAmount:2}, { color: laserColors.blue, maxAmount: 2, currentAmount: 2 },
{ color: laserColors.yellow, maxAmount: 1, currentAmount: 1 }, { color: laserColors.yellow, maxAmount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, 10, 6, 18, 6, 11, 0, 12, 18, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 10, 27, 16, 16, 16, 16, 23, 0, 0, 0],
], */ ],
];
let currentLevelIndex = 0; let currentLevelIndex = 0;
const initialMirrorAngles = [ const initialMirrorAngles = [
@@ -136,6 +139,7 @@ const initialMirrorAngles = [
{ {
"2,9": 225, "2,9": 225,
}, },
{},
{} {}
]; ];
@@ -147,6 +151,7 @@ const buttonGroups = [
{ {
"9,4": 1, "9,4": 1,
}, },
{}
]; ];
const doorGroups = [ const doorGroups = [
@@ -157,6 +162,7 @@ const doorGroups = [
"4,6": 1, "4,6": 1,
}, },
{}, {},
{}
]; ];
const captorGroups = [ const captorGroups = [
@@ -165,6 +171,7 @@ const captorGroups = [
"2,6": 1, "2,6": 1,
}, },
{}, {},
{}
]; ];
const rotatorButtons = [ const rotatorButtons = [
@@ -176,6 +183,7 @@ const rotatorButtons = [
{ {
"3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 }, "3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 },
}, },
{}
]; ];
let laserDirection = { dx: 0, dy: 0 }; let laserDirection = { dx: 0, dy: 0 };
@@ -811,9 +819,15 @@ function loadGrid() {
case legend.captorTurnHorizontal: case legend.captorTurnHorizontal:
cell.classList.add("captor-turn-horizontale2"); cell.classList.add("captor-turn-horizontale2");
break; break;
case legend.cableTurnHorizontale3:
cell.classList.add("cable-turn-horizontale3");
break;
case legend.wallSemiAngle: case legend.wallSemiAngle:
cell.classList.add("wall-semi-angle"); cell.classList.add("wall-semi-angle");
break; break;
case legend.captorVerticalTop:
cell.classList.add("captor-vertical-top");
break;
} }
drawLaserInCell(cell, laserSegments[`${y},${x}`]); drawLaserInCell(cell, laserSegments[`${y},${x}`]);
@@ -1000,7 +1014,7 @@ function traceLaser() {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor); saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
laserActive = false; laserActive = false;
}else if(currentLaserColor === laserColors.yellow) { } else if (currentLaserColor === laserColors.yellow) {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor); saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
} else { } else {
laserActive = false; laserActive = false;
@@ -1019,7 +1033,7 @@ function traceLaser() {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor); saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
laserActive = false; laserActive = false;
}else if(currentLaserColor === laserColors.yellow) { } else if (currentLaserColor === laserColors.yellow) {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor); saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
} else { } else {
laserActive = false; laserActive = false;
@@ -1038,7 +1052,16 @@ function traceLaser() {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor); saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
laserActive = false; laserActive = false;
}else if(currentLaserColor === laserColors.yellow) { } else if (currentLaserColor === laserColors.yellow) {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
} else {
laserActive = false;
}
break;
case legend.captorVerticalTop:
if (currentLaserColor === laserColors.blue) {
laserDirection = reverseLaser(laserDirection);
} else if (currentLaserColor === laserColors.yellow) {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor); saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
} else { } else {
laserActive = false; laserActive = false;