Compare commits
4 Commits
update/ui
...
64b0e5e770
| Author | SHA1 | Date | |
|---|---|---|---|
| 64b0e5e770 | |||
| 57b37d0139 | |||
| 4939b74fad | |||
| 7e5de16a02 |
@@ -143,6 +143,24 @@ main {
|
|||||||
background-position: center;
|
background-position: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.captor {
|
||||||
|
background-color: #DADEEF;
|
||||||
|
background-image: url("../img/tiles/Capteur-1.svg");
|
||||||
|
background-size: 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cable {
|
||||||
|
background-color: #DADEEF;
|
||||||
|
background-image: url("../img/tiles/CableV.svg");
|
||||||
|
background-size: 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
.door {
|
.door {
|
||||||
background-color: #DADEEF;
|
background-color: #DADEEF;
|
||||||
background-image: url("../img/tiles/WoodenDoor.svg");
|
background-image: url("../img/tiles/WoodenDoor.svg");
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ const legend = {
|
|||||||
demiWallCornerDownRight: 12,
|
demiWallCornerDownRight: 12,
|
||||||
doorOpen: 13,
|
doorOpen: 13,
|
||||||
button2: 14,
|
button2: 14,
|
||||||
|
captor: 15,
|
||||||
|
cable: 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
const laserColors = {
|
const laserColors = {
|
||||||
@@ -44,20 +46,49 @@ let levels = [
|
|||||||
[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],
|
||||||
],
|
],
|
||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|
[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],
|
||||||
|
], */
|
||||||
];
|
];
|
||||||
|
|
||||||
let currentLevelIndex = 0;
|
let currentLevelIndex = 0;
|
||||||
|
|
||||||
const initialMirrorAngles = {
|
const initialMirrorAngles = {
|
||||||
"6,4": 315,
|
"6,4": 315,
|
||||||
|
"4,3": 315,
|
||||||
};
|
};
|
||||||
|
|
||||||
const buttonGroups = {
|
const buttonGroups = {
|
||||||
"4,6": 1,
|
"4,6": 1,
|
||||||
|
"4,7": 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
const doorGroups = {
|
const doorGroups = {
|
||||||
"4,7": 1,
|
"4,7": 1,
|
||||||
|
"4,8": 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
let laserDirection = { dx: 0, dy: 0 };
|
let laserDirection = { dx: 0, dy: 0 };
|
||||||
@@ -371,6 +402,12 @@ function loadGrid() {
|
|||||||
case legend.demiWallCornerDownRight:
|
case legend.demiWallCornerDownRight:
|
||||||
cell.classList.add("demi-wall-corner-down-right");
|
cell.classList.add("demi-wall-corner-down-right");
|
||||||
break;
|
break;
|
||||||
|
case legend.captor:
|
||||||
|
cell.classList.add("captor");
|
||||||
|
break;
|
||||||
|
case legend.cable:
|
||||||
|
cell.classList.add("cable");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
drawLaserInCell(cell, laserSegments[`${y},${x}`]);
|
drawLaserInCell(cell, laserSegments[`${y},${x}`]);
|
||||||
@@ -552,6 +589,28 @@ function finish() {
|
|||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function nextLevel() {
|
||||||
|
currentLevelIndex++;
|
||||||
|
|
||||||
|
isLevelFinished = false;
|
||||||
|
|
||||||
|
if (currentLevelIndex >= levels.length) {
|
||||||
|
currentLevelIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
initializeMirrorOrientations();
|
||||||
|
loadGrid();
|
||||||
|
laserSegments = {};
|
||||||
|
mirrorOrientations = {};
|
||||||
|
glassPlacements = {};
|
||||||
|
activatedButtons = {};
|
||||||
|
openedDoors = {};
|
||||||
|
traceLaser();
|
||||||
|
|
||||||
|
const winOverlay = document.querySelector(".win-overlay");
|
||||||
|
winOverlay.style.visibility = "hidden";
|
||||||
|
}
|
||||||
|
|
||||||
createPalette();
|
createPalette();
|
||||||
initializeMirrorOrientations();
|
initializeMirrorOrientations();
|
||||||
blockBrowserDrop();
|
blockBrowserDrop();
|
||||||
|
|||||||
Reference in New Issue
Block a user