Compare commits
2 Commits
1145d26e9d
...
cfeded5079
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfeded5079 | ||
|
|
1eb3aec524 |
@@ -48,6 +48,11 @@ const glassOptions = [
|
|||||||
{ color: laserColors.blue, maxAmount: 1, currentAmount: 1 },
|
{ color: laserColors.blue, maxAmount: 1, currentAmount: 1 },
|
||||||
{ color: laserColors.yellow, maxAmount: 1, currentAmount: 1 },
|
{ color: laserColors.yellow, maxAmount: 1, currentAmount: 1 },
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
{ color: laserColors.red, maxAmount: 2, currentAmount: 2 },
|
||||||
|
{ color: laserColors.blue, maxAmount: 2, currentAmount:2},
|
||||||
|
{ color: laserColors.yellow, maxAmount: 2, currentAmount: 2 },
|
||||||
|
],
|
||||||
[
|
[
|
||||||
{ color: laserColors.red, maxAmount: 2, currentAmount: 2 },
|
{ color: laserColors.red, maxAmount: 2, currentAmount: 2 },
|
||||||
{ color: laserColors.blue, maxAmount: 1, currentAmount: 1 },
|
{ color: laserColors.blue, maxAmount: 1, currentAmount: 1 },
|
||||||
@@ -84,12 +89,12 @@ 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, 6, 6, 6, 6, 6, 7, 10, 6, 6, 11, 0, 0, 0, 0],
|
[0, 6, 6, 6, 6, 6, 0, 10, 6, 6, 11, 0, 0, 0, 0],
|
||||||
[0, 1, 0, 0, 0, 4, 0, 0, 0, 3, 21, 0, 0, 0, 0],
|
[7, 1, 0, 0, 0, 4, 0, 0, 0, 3, 21, 0, 0, 0, 0],
|
||||||
[0, 6, 6, 6, 6, 18, 6, 26, 22, 0, 18, 0, 0, 0, 0],
|
[0, 6, 6, 6, 6, 18, 6, 26, 22, 0, 18, 0, 0, 0, 0],
|
||||||
[0, 6, 9, 0, 0, 19, 0, 0, 0, 12, 18, 0, 0, 0, 0],
|
[0, 6, 9, 0, 0, 19, 0, 0, 0, 12, 18, 0, 0, 0, 0],
|
||||||
[0, 6, 0, 6, 6, 6, 6, 6, 6, 24, 23, 0, 0, 0, 0],
|
[0, 6, 0, 6, 6, 6, 6, 6, 6, 24, 23, 0, 0, 0, 0],
|
||||||
[0, 6, 11, 0, 0, 0, 0, 0, 25, 23, 9, 0, 0, 0, 0],
|
[0, 6, 11, 0, 0, 0, 0, 0, 20, 23, 9, 0, 0, 0, 0],
|
||||||
[0, 10, 6, 6, 6, 6, 6, 6, 6, 9, 0, 0, 0, 0, 0],
|
[0, 10, 6, 6, 6, 6, 6, 6, 6, 9, 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],
|
||||||
@@ -131,9 +136,9 @@ const initialMirrorAngles = [
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
"3,4": 315,
|
"2,9": 225,
|
||||||
"7,8": 0,
|
|
||||||
},
|
},
|
||||||
|
{}
|
||||||
];
|
];
|
||||||
|
|
||||||
const buttonGroups = [
|
const buttonGroups = [
|
||||||
@@ -141,7 +146,9 @@ const buttonGroups = [
|
|||||||
"4,6": 1,
|
"4,6": 1,
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
{},
|
{
|
||||||
|
"9,4": 1,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const doorGroups = [
|
const doorGroups = [
|
||||||
@@ -165,6 +172,9 @@ const captorGroups = [
|
|||||||
const rotatorButtons = [
|
const rotatorButtons = [
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
|
{
|
||||||
|
"6,8": { mirrorX: 9, mirrorY: 2, step: 22.5, intervalMs: 1000 },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 },
|
"3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 },
|
||||||
},
|
},
|
||||||
@@ -891,7 +901,7 @@ function traceLaser() {
|
|||||||
switch (cellType) {
|
switch (cellType) {
|
||||||
case legend.laser:
|
case legend.laser:
|
||||||
case legend.coloredLaser:
|
case legend.coloredLaser:
|
||||||
laserActive = false;
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case legend.empty:
|
case legend.empty:
|
||||||
@@ -922,7 +932,27 @@ function traceLaser() {
|
|||||||
laserActive = false;
|
laserActive = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case legend.wallSemiAngle:
|
||||||
|
if (currentLaserColor === laserColors.blue) {
|
||||||
|
laserDirection = reverseLaser(laserDirection);
|
||||||
|
} else if (currentLaserColor === laserColors.yellow) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
|
} else {
|
||||||
|
laserActive = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case legend.horizontalSemi:
|
||||||
|
if (currentLaserColor === laserColors.blue) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
|
laserDirection = reflectLaser(laserDirection, 0);
|
||||||
|
} else if (currentLaserColor === laserColors.yellow) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
|
} else {
|
||||||
|
laserActive = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case legend.cableVertical:
|
||||||
|
case legend.cableTurn:
|
||||||
case legend.door:
|
case legend.door:
|
||||||
case legend.doorOpen:
|
case legend.doorOpen:
|
||||||
if (openedDoors[`${currentY},${currentX}`] || cellType === legend.doorOpen) {
|
if (openedDoors[`${currentY},${currentX}`] || cellType === legend.doorOpen) {
|
||||||
@@ -951,6 +981,14 @@ function traceLaser() {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case legend.captor:
|
case legend.captor:
|
||||||
|
if (currentLaserColor === laserColors.blue) {
|
||||||
|
laserDirection = reverseLaser(laserDirection);
|
||||||
|
} else if (currentLaserColor === laserColors.yellow) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
|
} else {
|
||||||
|
laserActive = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case legend.captorTurn:
|
case legend.captorTurn:
|
||||||
if (currentLaserColor === laserColors.red) {
|
if (currentLaserColor === laserColors.red) {
|
||||||
const captorKey = `${currentY},${currentX}`;
|
const captorKey = `${currentY},${currentX}`;
|
||||||
@@ -1029,6 +1067,7 @@ function traceLaser() {
|
|||||||
if (currentLaserColor === laserColors.yellow) {
|
if (currentLaserColor === laserColors.yellow) {
|
||||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
} else if (currentLaserColor === laserColors.blue) {
|
} else if (currentLaserColor === laserColors.blue) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
laserDirection = reflectLaser(laserDirection, 135);
|
laserDirection = reflectLaser(laserDirection, 135);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1037,6 +1076,7 @@ function traceLaser() {
|
|||||||
if (currentLaserColor === laserColors.yellow) {
|
if (currentLaserColor === laserColors.yellow) {
|
||||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
} else if (currentLaserColor === laserColors.blue) {
|
} else if (currentLaserColor === laserColors.blue) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
laserDirection = reflectLaser(laserDirection, 45);
|
laserDirection = reflectLaser(laserDirection, 45);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1045,6 +1085,7 @@ function traceLaser() {
|
|||||||
if (currentLaserColor === laserColors.yellow) {
|
if (currentLaserColor === laserColors.yellow) {
|
||||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
} else if (currentLaserColor === laserColors.blue) {
|
} else if (currentLaserColor === laserColors.blue) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
laserDirection = reflectLaser(laserDirection, 225);
|
laserDirection = reflectLaser(laserDirection, 225);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1053,6 +1094,7 @@ function traceLaser() {
|
|||||||
if (currentLaserColor === laserColors.yellow) {
|
if (currentLaserColor === laserColors.yellow) {
|
||||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
} else if (currentLaserColor === laserColors.blue) {
|
} else if (currentLaserColor === laserColors.blue) {
|
||||||
|
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||||
laserDirection = reflectLaser(laserDirection, 315);
|
laserDirection = reflectLaser(laserDirection, 315);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1086,17 +1128,17 @@ function goToLevel(levelIndex) {
|
|||||||
isLevelFinished = false;
|
isLevelFinished = false;
|
||||||
stopAllRotatorButtons();
|
stopAllRotatorButtons();
|
||||||
|
|
||||||
|
mirrorOrientations = {};
|
||||||
|
laserSegments = {};
|
||||||
|
activatedButtons = {};
|
||||||
|
openedDoors = {};
|
||||||
|
toggledDoors = {};
|
||||||
|
poweredCaptors = {};
|
||||||
initializeMirrorOrientations();
|
initializeMirrorOrientations();
|
||||||
glassPlacements = {};
|
glassPlacements = {};
|
||||||
resetGlassInventory();
|
resetGlassInventory();
|
||||||
createPalette();
|
createPalette();
|
||||||
loadGrid();
|
loadGrid();
|
||||||
laserSegments = {};
|
|
||||||
mirrorOrientations = {};
|
|
||||||
activatedButtons = {};
|
|
||||||
openedDoors = {};
|
|
||||||
toggledDoors = {};
|
|
||||||
poweredCaptors = {};
|
|
||||||
traceLaser();
|
traceLaser();
|
||||||
|
|
||||||
const winOverlay = document.querySelector(".win-overlay");
|
const winOverlay = document.querySelector(".win-overlay");
|
||||||
|
|||||||
Reference in New Issue
Block a user