Build a polished, playable browser game: три в ряд. Make the core loop fun within the…
- User
Build a polished, playable browser game: три в ряд. Make the core loop fun within the first ten seconds, with tight controls for both keyboard and touch, and juicy feedback — screen shake, particle effects, and satisfying animations. Include a start screen, a score system, pause and game-over states with instant restart, and a local high-score table. Style it with a cohesive visual theme and make sure it runs smoothly at 60fps on desktop and mobile.
Assistant
I will start by exploring the project structure to see the existing files.
I will check
package.jsonto see what packages and dependencies are currently installed.I will now install
lucide-reactfor rich UI iconography andcanvas-confettifor celebratory effects on level completion and high scores.I will install
lucide-react,canvas-confetti, and@types/canvas-confettiusing standard npm package naming.I will read
index.htmlto update the title and ensure proper viewport and metadata for mobile touch gameplay.I will check
src/index.cssto see the current styling setup and Tailwind imports.I will check
src/utils/cn.ts.I will update
index.htmlwith a descriptive title, mobile viewport lock (so swiping on mobile doesn't scroll/zoom the web page unexpectedly), and Google Fonts (OutfitandRusso One) to give our "Три в ряд" (Match-3) jewel game a vivid, polished arcade look.I will now enhance
src/index.csswith custom animations and utility classes for jewel glow, shake effects, score float-up animations, and prevent default mobile touch behaviors on the game grid.I will now create
src/utils/soundEngine.tsusing the Web Audio API to generate high-fidelity, instant sound effects (such as crystal clinks, ascending combo chords, bomb blasts, laser line clears, and fanfare) with zero external file load delays.I will fix the TypeScript warning in
src/utils/soundEngine.tsby utilizingcomboPitchIndexinside the sound generation or removing the unused private variable.I will create
src/types/game.tsdefining all jewel types, special power-up gems, grid items, animation states, game modes, level goals, particle effects, and achievement structures.I will create
src/utils/gemConstants.tsto store visual definitions, color schemes, SVGs/icons for crystal shapes, and power-up indicators.I will create
src/utils/gridEngine.tsto handle grid creation with no starting matches, valid move detection, automatic reshuffle when no moves exist, match detection with power-up generation rules, and gravity/cascade calculation.I will create
src/utils/storageEngine.tsto manage local high-score leaderboards (with starter scores), persistent achievements/quests progress, and game settings (like sound and mobile haptic vibration).I will create
src/components/Navbar.tsxdisplaying current level progression, score, moves/time remaining, sound controls, achievements button, and pause trigger.I will create
src/components/StartScreen.tsxwith mode selection cards, animated jewel preview icons, rule breakdown, and high scores quick access.I will create
src/components/AchievementsModal.tsxshowing the full checklist of trophies and quests with progress bars and unlocked stamps.I will fix the nested quotes inside
classNameinsrc/components/AchievementsModal.tsx.I will create
src/components/LeaderboardModal.tsxshowing the local high-score table with mode filter tabs and dates.I will create
src/components/PauseModal.tsxwith Resume, Restart, Sound Toggle, and Exit to Menu actions.I will create
src/components/GameOverModal.tsxhandling level victories, game overs, confetti bursts, stats recap, and leaderboard submission.I will create
src/components/GemCell.tsxrendering high-fidelity crystal shapes with glowing power-up indicators, tap selection, swipe/touch drag detection, and keyboard highlight.I will create
src/components/SettingsModal.tsxfor sound, haptics, and visual fx customization.I will create
src/components/GameBoard.tsxcontaining the 8x8 crystal grid, particle burst canvas engine, floating score layer, keyboard arrow cursor selector, and idle hint system.I will remove the unused
GEM_VISUALSimport insrc/components/GameBoard.tsx.I will now create
src/App.tsximplementing the complete game loop, cascade engine with gravity, combo scoring, power-up detonations, level transition goals, floating score animations, high score storage, and modal management.I will clean up the unused
Reactimport insrc/App.tsx.I will now run
build_project(npm run build) to test our TypeScript types and verify that our kinetic Match-3 game compiles cleanly.I have created ЦВЕТНЫЕ КРИСТАЛЛЫ: ТРИ В РЯД (Kinetic Gems Match-3) — a fast-paced, highly polished Match-3 browser game engineered for 60FPS performance on desktop and mobile.
✨ What I Built & Key Highlights
-
Immediate Fun & Replayability within the First 10 Seconds:
- No Dead Starts: The board generation algorithm guarantees 0 starting matches while ensuring at least 1 valid swap exists right out of the gate.
- 5-Second Idle Hint: If the player pauses to look around, the game automatically scans the board and pulses a valid jewel swap (
💡 hint system). - Synthesizer Web Audio API: Instant sound effects with zero file load lag — crystal chimes scale upward in pitch (
C5→D5→E5→G5→C6) with every cascade combo multiplier!
-
Tight & Responsive Multimodal Controls:
- Touch & Swipe: Tap two adjacent jewels, or simply touch down and swipe/drag your finger or mouse (> 28px) in any direction for instant, zero-delay swapping.
- Keyboard Navigation: Use
Arrow Keys(orW/A/S/D) to move the selection cursor across the 8x8 matrix and pressEnterorSpaceto select/swap.
-
Juicy Feedback & Alchemy Power-Ups:
- Power-Up Jewels Created by Skill:
⚡ Zap Lightning(Horizontal or Vertical line clear) created by matching 4 jewels in a row.💥 Nova Bomb(Explodes clearing a 3x3 surrounding radius) created byLorTshaped intersections.🌈 Rainbow Prism(Destroys all jewels of any swapped color from the entire board) forged by matching 5 in a row.
- Particle Physics Burst Engine: A dedicated HTML5
<canvas>layer explodes with glowing crystal shards on every clear. - Floating Score Popups: Scores (
+150,+450 x3 КОМБО!,💥 ВЗРЫВ +1200!) float upward and fade out. - 3-Tier Screen Shake: Subtle camera shakes on standard matches (
small), energetic shakes on bombs/combos (medium), and intense shakes (heavy) when triggering a Rainbow Prism or huge chain reaction.
- Power-Up Jewels Created by Skill:
-
Modes, Progression, & Local Leaderboard:
- 🎮 Аркада (Arcade): Level progression with target scores, limited moves, and difficulty scaling.
- ⚡ Тайм-Атака (Time Attack - 60s): High-speed frenzy where every cascade explosion adds +2 bonus seconds to the clock.
- 🧘 Дзен (Zen Endless): Infinite relaxation with zero timers or move limits.
- Local High-Score Table & Achievements: Persistent
localStoragehigh-score leaderboard with player name entry, alongside an 8-quest achievement checklist (First Spark,Nova Alchemist,Combo Master x6,Treasure Hunter). - Pause, Settings, & Instant Restart: Toggle Web Audio FX, haptic vibration, visual effects intensity (
High/Low), or instantly retry any level without reloading.
Files built:
index.html,src/index.css,src/utils/soundEngine.ts,src/types/game.ts,src/utils/gemConstants.ts,src/utils/gridEngine.ts,src/utils/storageEngine.ts,src/components/Navbar.tsx,src/components/StartScreen.tsx,src/components/AchievementsModal.tsx,src/components/LeaderboardModal.tsx,src/components/PauseModal.tsx,src/components/GameOverModal.tsx,src/components/GemCell.tsx,src/components/SettingsModal.tsx,src/components/GameBoard.tsx,src/App.tsx-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.