Commit Graph

23 Commits

Author SHA1 Message Date
Sysy's
954af3cded Fix relative paths 2026-03-31 14:55:00 +02:00
1145d26e9d add lvl 4 2026-03-31 14:27:06 +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
6229fe7b9e Level 3 2026-03-31 13:49:02 +02:00
Sysy's
f3809db72b Merge branch 'feature/grid' of https://git.ninolbt.com/Nono/Projet_48h into feature/grid 2026-03-31 13:12:34 +02:00
Sysy's
68b6493e50 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:11:30 +02:00
a267884dbe Level 3 2026-03-31 12:59:59 +02:00
57b37d0139 Level 2 2026-03-31 12:16:45 +02:00
Sysy's
49045e4d76 Add win overlay 2026-03-31 12:07:37 +02:00
Sysy's
43100e65e9 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 12:00:03 +02:00
Sysy's
94ddc4a00f Make size bigger + add ads 2026-03-31 11:55:20 +02:00
Sysy's
abf097e117 Fix textures/button/lasers & add ads 2026-03-31 11:52:30 +02:00
4fc21e7876 Resolution merge conflicts 2026-03-31 11:32:40 +02:00
37aa7b5067 Map modified + sprites 2026-03-31 10:57:19 +02:00
Sysy's
09d54aa525 Add diagonal lasers 2026-03-31 09:46:29 +02:00
Sysy's
76de2a5a5c Remove player + right click change rotation mirror 2026-03-31 09:40:25 +02:00
Sysy's
4ba42f6566 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 09:20:28 +02:00
024b80d393 Upgrade of design of light of laser + add posibility to move a cursor and rotate mirror with keyboard 2026-03-30 22:06:44 +02:00
34fbb797c1 Laser print and reflect 2026-03-30 16:48:53 +02:00
2dbfff770f Grid enlargement 2026-03-30 15:29:25 +02:00
a791415bd3 Rebase of feature/mirror + merge with the grid program 2026-03-30 15:05:57 +02:00
1be3750672 Change index.js and index.css to game.js and game.css 2026-03-30 14:51:37 +02:00