Level 5
This commit is contained in:
@@ -24,10 +24,12 @@ const legend = {
|
||||
rotatorButton: 20,
|
||||
cableTurn: 21,
|
||||
horizontalSemi: 22,
|
||||
cableTurnHorizontale : 23,
|
||||
cableTurnHorizontale2 : 24,
|
||||
captorTurnHorizontal : 25,
|
||||
cableTurnHorizontale: 23,
|
||||
cableTurnHorizontale2: 24,
|
||||
captorTurnHorizontal: 25,
|
||||
wallSemiAngle: 26,
|
||||
cableTurnHorizontale3: 27,
|
||||
captorVerticalTop: 28
|
||||
};
|
||||
|
||||
const laserColors = {
|
||||
@@ -50,7 +52,7 @@ const glassOptions = [
|
||||
],
|
||||
[
|
||||
{ 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 },
|
||||
],
|
||||
[
|
||||
@@ -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}`]);
|
||||
@@ -1000,7 +1014,7 @@ function traceLaser() {
|
||||
|
||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||
laserActive = false;
|
||||
}else if(currentLaserColor === laserColors.yellow) {
|
||||
} else if (currentLaserColor === laserColors.yellow) {
|
||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||
} else {
|
||||
laserActive = false;
|
||||
@@ -1019,7 +1033,7 @@ function traceLaser() {
|
||||
|
||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||
laserActive = false;
|
||||
}else if(currentLaserColor === laserColors.yellow) {
|
||||
} else if (currentLaserColor === laserColors.yellow) {
|
||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||
} else {
|
||||
laserActive = false;
|
||||
@@ -1038,7 +1052,16 @@ function traceLaser() {
|
||||
|
||||
saveLaserSegment(currentX, currentY, laserDirection, currentLaserColor);
|
||||
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);
|
||||
} else {
|
||||
laserActive = false;
|
||||
|
||||
Reference in New Issue
Block a user