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;
}
.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 {
background-color: #DADEEF;
background-image: url("/web/assets/img/tiles/CableH.svg");
@@ -274,6 +283,14 @@ main {
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 {
background-color: #DADEEF;
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

@@ -28,6 +28,8 @@ const legend = {
cableTurnHorizontale2: 24,
captorTurnHorizontal: 25,
wallSemiAngle: 26,
cableTurnHorizontale3: 27,
captorVerticalTop: 28
};
const laserColors = {
@@ -112,20 +114,21 @@ let levels = [
[0, 0, 0, 0, 6, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 10, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0],
],
];
/*
[
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
], */
[0, 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 11, 0],
[0, 12, 6, 9, 0, 10, 6, 9, 0, 0, 0, 3, 0, 17, 0],
[12, 6, 9, 0, 0, 0, 6, 0, 7, 0, 0, 0, 0, 18, 0],
[6, 9, 0, 0, 0, 0, 6, 11, 0, 0, 12, 0, 0, 18, 0],
[1, 0, 0, 0, 0, 12, 6, 6, 11, 0, 0, 3, 0, 18, 0],
[10, 6, 11, 0, 0, 6, 0, 0, 10, 6, 6, 6, 6, 18, 0],
[0, 10, 6, 28, 6, 9, 0, 0, 0, 10, 6, 6, 24, 23, 0],
[0, 0, 10, 27, 16, 3, 4, 0, 0, 0, 10, 24, 23, 0, 0],
[0, 0, 0, 0, 10, 6, 18, 6, 11, 0, 12, 18, 0, 0, 0],
[0, 0, 0, 0, 0, 10, 27, 16, 16, 16, 16, 23, 0, 0, 0],
],
];
let currentLevelIndex = 0;
const initialMirrorAngles = [
@@ -136,6 +139,7 @@ const initialMirrorAngles = [
{
"2,9": 225,
},
{},
{}
];
@@ -147,6 +151,7 @@ const buttonGroups = [
{
"9,4": 1,
},
{}
];
const doorGroups = [
@@ -157,6 +162,7 @@ const doorGroups = [
"4,6": 1,
},
{},
{}
];
const captorGroups = [
@@ -165,6 +171,7 @@ const captorGroups = [
"2,6": 1,
},
{},
{}
];
const rotatorButtons = [
@@ -176,6 +183,7 @@ const rotatorButtons = [
{
"3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 },
},
{}
];
let laserDirection = { dx: 0, dy: 0 };
@@ -811,9 +819,15 @@ function loadGrid() {
case legend.captorTurnHorizontal:
cell.classList.add("captor-turn-horizontale2");
break;
case legend.cableTurnHorizontale3:
cell.classList.add("cable-turn-horizontale3");
break;
case legend.wallSemiAngle:
cell.classList.add("wall-semi-angle");
break;
case legend.captorVerticalTop:
cell.classList.add("captor-vertical-top");
break;
}
drawLaserInCell(cell, laserSegments[`${y},${x}`]);
@@ -1044,6 +1058,15 @@ function traceLaser() {
laserActive = false;
}
break;
case legend.captorVerticalTop:
if (currentLaserColor === laserColors.blue) {
laserDirection = reverseLaser(laserDirection);
} else if (currentLaserColor === laserColors.yellow) {
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
} else {
laserActive = false;
}
break;
case legend.rotatorButton:
if (currentLaserColor === laserColors.red) {
const rotatorKey = `${currentY},${currentX}`;