Commit Graph

22 Commits

Author SHA1 Message Date
M1n-0
4a21f85a37 fix others mistake 2026-03-31 14:36:14 +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
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
e787094078 Rebase of feature/mirror + merge with the grid program 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