Commit Graph

82 Commits

Author SHA1 Message Date
Sysy's
6127e53708 Fix level 3 2026-03-31 15:19:59 +02:00
M1n-0
2f9da6b38e ishallah V3 2026-03-31 15:00:55 +02:00
M1n-0
2b8dc254bf ishallah V2 2026-03-31 15:00:22 +02:00
M1n-0
068ad3dd92 ishallah 2026-03-31 14:59:26 +02:00
Sysy's
954af3cded Fix relative paths 2026-03-31 14:55:00 +02:00
Sysy's
cfeded5079 X 2026-03-31 14:53:26 +02:00
M1n-0
ac9ba24857 fix path error 2026-03-31 14:44:37 +02:00
M1n-0
b15ca69499 fix path error 2026-03-31 14:43:41 +02:00
M1n-0
12e8ac34d4 fix path error 2026-03-31 14:38:43 +02:00
M1n-0
4a21f85a37 fix others mistake 2026-03-31 14:36:14 +02:00
Sysy's
1eb3aec524 Update game.js 2026-03-31 14:35:01 +02:00
M1n-0
647e5b9048 fix this shitty html 2026-03-31 14:33:40 +02:00
M1n-0
903a1de933 add route /game in backend 2026-03-31 14:31:40 +02:00
M1n-0
fa1ffc214c fix path in html 2026-03-31 14:28:01 +02:00
1145d26e9d add lvl 4 2026-03-31 14:27:06 +02:00
Sysy's
f4c821ae97 Replace void with walls 2026-03-31 14:16:05 +02:00
Sysy's
90a0de0429 Add level selection menu and persistence
Introduce a level selection UI and persistence for unlocked levels. Adds CSS styles and HTML markup for a floating level menu, and JS to load/save highest unlocked level to localStorage (key: mirror-game-highest-unlocked-level). Implements functions to render/toggle the menu, unlock levels on finish, and navigate to arbitrary levels via goToLevel. nextLevel now delegates to goToLevel, and setup calls loadUnlockedLevels() and setupLevelMenu() so the menu reflects progress immediately.
2026-03-31 14:10:37 +02:00
Sysy's
34d213d5f4 Support limited glass inventory and yellow laser
Introduce per-level glass inventory and UI for draggable glass pieces, including disabled state and count labels. glassOptions now hold objects with color, maxAmount and currentAmount; palette creation uses these values to enable/disable dragging, show remaining counts, and update on place/remove. Drag-and-drop logic now tracks a draggedGlassColor fallback, prevents placing when inventory is empty, decrements/increments inventory on place/remove, and rebuilds the palette. Reset inventory on level start and when advancing levels. Also adjust laser tracing: yellow lasers are saved as segments and terminate on target, and yellow interacts with demi-wall corners by saving the segment instead of reflecting (blue still reflects). Add CSS for .glass-item:disabled and .glass-item-label. Overall fixes inventory handling and yellow-laser behavior.
2026-03-31 14:05:35 +02:00
M1n-0
11d47caf1e fix merge 2026-03-31 13:56:58 +02:00
6229fe7b9e Level 3 2026-03-31 13:49:02 +02:00
Sysy's
36fa5a9092 Support per-level game element configs
Convert global config maps (initialMirrorAngles, buttonGroups, doorGroups, captorGroups, rotatorButtons) into per-level arrays and add getCurrentLevelConfig(levelConfigs) helper. Update getButtonGroup, getDoorGroup, getCaptorGroup, getRotatorButtonConfig, isMirrorControlledByButton, syncRotatorButtons and initializeMirrorOrientations to pull configs for the current level. Also tweak a couple of level tiles and add a rotator button config for the third level ("3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 }) while keeping empty objects for levels without overrides. These changes enable per-level customization of mirrors, buttons, doors, captors and rotators.
2026-03-31 13:39:58 +02:00
Sysy's
f9e94f5c18 Implement captors and color-dependent laser effects
Add captor support and related door-toggling state plus color-specific laser interactions. Changes include: replace one level tile value (15 -> 20), add captorGroups/getCaptorGroup, add toggleDoorsFromCaptor, and new state (toggledDoors, poweredCaptors). traceLaser now initializes openedDoors from toggledDoors, tracks nextPoweredCaptors, handles captor tiles (red lasers power/toggle door groups, yellow passes, others stop), updates poweredCaptors, and applies color-based behavior for rotator buttons and demi-wall reflections (only reflect for blue). Reset toggledDoors and poweredCaptors on next level. These changes implement captor mechanics that toggle door groups and ensure correct color-dependent laser effects.
2026-03-31 13:39:58 +02:00
Sysy's
1ad8282833 Remove rotatorButton on lvl 1 2026-03-31 13:39:58 +02:00
4b8a650c26 Level 3 2026-03-31 13:39:52 +02:00
Sysy's
94a60de6b2 Add rotator buttons and auto-rotating mirrors
Introduce a new rotator button tile and mirror auto-rotation feature. CSS adds styles for rotator buttons and locked mirror display. JS: add legend entry and rotatorButtons config, track activeRotatorButtons and rotatorIntervals, implement rotateMirrorStep, isMirrorControlledByButton, syncRotatorButtons and stopAllRotatorButtons; wire rotator behavior into traceLaser and loadGrid so rotator buttons activate intervals that rotate target mirrors automatically and lock out manual rotation. Refactor rotateMirror to reuse rotation step logic and ensure rotator intervals are cleared when advancing levels.
2026-03-31 13:38:24 +02:00
663e89de9e Level 2 2026-03-31 13:38:24 +02:00
0ccd551ef8 Level 2 2026-03-31 13:38:24 +02:00
7131b876cc Level 2 2026-03-31 13:38:24 +02:00
Sysy's
8517ac89da Add win overlay 2026-03-31 13:38:24 +02:00
Sysy's
be14f4513c Add game title and update layout styles
Adjust UI visuals: change page background to #FFF6E5, increase main container border-radius from 10px to 150px, and soften toolbox corners (5px → 15px). Add a new .game-title CSS rule (responsive font-size, weight, color, letter-spacing, centered) and insert an <h1 class="game-title">Mirror Game</h1> into the game template. These are visual polish changes only; no gameplay logic was modified.
2026-03-31 13:38:24 +02:00
Sysy's
0c2d989ad8 Make size bigger + add ads 2026-03-31 13:38:24 +02:00
Sysy's
1c59e7af7a Fix textures/button/lasers & add ads 2026-03-31 13:38:24 +02:00
63c4244e92 Resolution merge conflicts 2026-03-31 13:38:24 +02:00
4d1ed00f03 Map modified + sprites 2026-03-31 13:38:24 +02:00
Sysy's
40a8dee263 Add diagonal lasers 2026-03-31 13:38:24 +02:00
Sysy's
d8f56cb548 Remove player + right click change rotation mirror 2026-03-31 13:38:24 +02:00
Sysy's
853a6ae9ee Make mirror rotate on click 2026-03-31 13:38:24 +02:00
Sysy's
6d81f67ddf Track laser segments and update UI theme
Add per-cell laserSegments tracking and use it to render correct laser orientation: introduce laserSegments global, reset it at trace start, populate entries when tracing, and consult it in loadGrid to choose horizontal vs vertical classes. Update UI styling from a dark to a lighter theme (body and main backgrounds, cell/empty/mirror/wall colors and laser gradients), remove some borders/fit-content sizing, and add a "map" class to the map container in the HTML. These changes fix laser orientation rendering and refresh the game's visual theme.
2026-03-31 13:38:24 +02:00
2c03331663 Upgrade of design of light of laser + add posibility to move a cursor and rotate mirror with keyboard 2026-03-31 13:38:03 +02:00
3e6a2130e9 Laser print and reflect 2026-03-31 13:38:02 +02:00
2eb7bd46dc First version of button for mirrors 2026-03-31 13:38:02 +02:00
a9c4c653d2 Grid enlargement 2026-03-31 13:38:02 +02:00
e787094078 Rebase of feature/mirror + merge with the grid program 2026-03-31 13:38:02 +02:00
Sysy's
1ade298ff5 Add rotateMirror to rotate element 45°
Add a small utility function in web/assets/js/index.js that increments an element's CSS rotation by 45 degrees. The function reads the element's inline transform (handling an empty value), parses the current rotation angle modulo 360, and sets the new rotate(angle+45) value.
2026-03-31 13:38:02 +02:00
d5a84144ef Change index.js and index.css to game.js and game.css 2026-03-31 13:38:02 +02:00
1276edf2f2 End of grid 2026-03-31 13:38:02 +02:00
90e2064ec9 First version of laser 2026-03-31 13:38:02 +02:00
34b76b2cb9 Print grid on html + minimalist css (which will not be used) 2026-03-31 13:38:02 +02:00
Sysy's
a9d2a0c9a5 Support per-level game element configs
Convert global config maps (initialMirrorAngles, buttonGroups, doorGroups, captorGroups, rotatorButtons) into per-level arrays and add getCurrentLevelConfig(levelConfigs) helper. Update getButtonGroup, getDoorGroup, getCaptorGroup, getRotatorButtonConfig, isMirrorControlledByButton, syncRotatorButtons and initializeMirrorOrientations to pull configs for the current level. Also tweak a couple of level tiles and add a rotator button config for the third level ("3,7": { mirrorX: 7, mirrorY: 7, step: -22.5, intervalMs: 1000 }) while keeping empty objects for levels without overrides. These changes enable per-level customization of mirrors, buttons, doors, captors and rotators.
2026-03-31 13:34:27 +02:00
Sysy's
9c7c2ddc1d Implement captors and color-dependent laser effects
Add captor support and related door-toggling state plus color-specific laser interactions. Changes include: replace one level tile value (15 -> 20), add captorGroups/getCaptorGroup, add toggleDoorsFromCaptor, and new state (toggledDoors, poweredCaptors). traceLaser now initializes openedDoors from toggledDoors, tracks nextPoweredCaptors, handles captor tiles (red lasers power/toggle door groups, yellow passes, others stop), updates poweredCaptors, and applies color-based behavior for rotator buttons and demi-wall reflections (only reflect for blue). Reset toggledDoors and poweredCaptors on next level. These changes implement captor mechanics that toggle door groups and ensure correct color-dependent laser effects.
2026-03-31 13:27:08 +02:00