Act as a Senior Front-End Engineer and Game Developer. I need you to architect and build…
- User
Act as a Senior Front-End Engineer and Game Developer. I need you to architect and build a mobile-first Match-3 game (Candy Crush style) using vanilla JavaScript, HTML5 Canvas, or a lightweight framework like Phaser.js.
CRITICAL REQUIREMENT: NO HARDCODED ASSETS. EVERYTHING MUST BE CONFIGURABLE.
-
Architecture & Asset Management:
- Create a centralized
GameConfigobject (JSON format) that defines every visual and logical element. - Do not hardcode URLs, colors, shapes, or sizes in the game logic.
- The config should support:
- Tile types (ID, name, image URL, color, shape, sound effect URL, crushing sound).
- Match patterns (horizontal, vertical, L-shape, T-shape).
- Grid size (rows, columns).
- Win/Loss conditions (score target, moves limit, time limit).
- Special candy behaviors (e.g., "color bomb" clears random color, "striped" clears row/col).
- Create a centralized
-
Mobile Responsiveness:
- The game board must scale perfectly to any mobile screen size using viewport-relative units (vw/vh, rem).
- Implement touch controls:
- Swipe detection for moving tiles.
- Tap-and-drag or tap-to-select mechanics.
- Prevent default zooming/scrolling on the game board.
- Ensure the UI (score, moves, buttons) is legible and accessible on small screens.
-
Visuals & Assets:
- Use SVG shapes or base64 placeholders by default, but design the engine to load external images/Spritesheets defined in the
GameConfig. - Implement a simple animation system (tweening) for moving tiles, swapping, and clearing, driven by the config.
- Ensure the game runs smoothly on mobile devices (60fps) without lag.
- Use SVG shapes or base64 placeholders by default, but design the engine to load external images/Spritesheets defined in the
-
Extensibility:
- Provide a clear example of how to add a new "level" by simply copying a config block.
- Provide a clear example of how to add a new "candy type" by adding an entry to the tile list and pointing to a new asset URL.
- The code must be modular: separate the Game Loop, Input Handler, Grid Logic, and Renderer.
-
Deliverables:
- A complete, single-file or modular codebase.
- A
config.jsonfile demonstrating at least 3 different candy types and 2 levels. - Instructions on how to swap the default assets with custom images.
-
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.