diff --git a/web/assets/css/game.css b/web/assets/css/game.css index 36c842a..c74209e 100644 --- a/web/assets/css/game.css +++ b/web/assets/css/game.css @@ -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"); diff --git a/web/assets/img/fakeimg.img b/web/assets/img/fakeimg.img new file mode 100644 index 0000000..e69de29 diff --git a/web/assets/img/image_game.png b/web/assets/img/image_game.png deleted file mode 100644 index 19841bc..0000000 Binary files a/web/assets/img/image_game.png and /dev/null differ diff --git a/web/assets/img/img_test_main_menu.png b/web/assets/img/img_test_main_menu.png new file mode 100644 index 0000000..5951742 Binary files /dev/null and b/web/assets/img/img_test_main_menu.png differ diff --git a/web/assets/js/game.js b/web/assets/js/game.js index 4732bca..c04a26a 100644 --- a/web/assets/js/game.js +++ b/web/assets/js/game.js @@ -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;