Yin and Yang - Match-3 Puzzle Game

Seele01-Flash
By
Yin and Yang is an engaging match-3 puzzle game where players match colorful cubes to clear the board. With flexible matching rules and endless gameplay, it offers both relaxing and challenging puzzle-solving experience.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Yin and Yang (Match-3 Puzzle)". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: A clean, vibrant 3D puzzle aesthetic simulating a "glossy candy" look. * **Grid & Blocks**: Create a centered 8x8 grid. The blocks should be 3D rounded cubes (BoxGeometry with bevels) to catch light. * **Colors & Textures**: * Basic Blocks: High-saturation glossy materials (MeshPhysicalMaterial) in Red, Blue, and Yellow. * Special Blocks ("Yin" and "Yang"): Purple/Pink blocks containing a texture or a simple geometric representation of the Yin-Yang symbol (or an "eye" shape as seen in the reference). * **Lighting**: Use a Three-point lighting setup (Ambient + Directional) to create specular highlights on the rounded edges of the blocks, emphasizing the "jelly-like" quality. * **Background**: A deep, dark blue solid color (`#1a1a40`) to provide high contrast for the colorful blocks. * **Camera**: Use an **OrthographicCamera** to maintain the strict grid alignment and 2D gameplay feel while preserving 3D object depth. * **Optimization**: Reuse geometries and materials. Ensure the scene renders at 60fps on mobile devices by keeping polygon counts low for individual blocks. ### 2. Audio Requirements * **BGM**: A relaxing, Zen-inspired electronic track. Moderate tempo, looping seamlessly to support a "flow state" for the player. * **Sound Effects (SFX)**: * *Select*: A soft "click" or high-pitched tap sound. * *Swap/Slide*: A quick "whoosh" or friction sound. * *Match/Blast*: A satisfying "pop", "glass break", or "crunch" sound. * *Falling*: A subtle rattle when blocks drop down to fill empty spaces. * *Special Activation*: A mystical chime when Yin/Yang blocks are cleared. ### 3. Gameplay Loop * **Core Mechanic**: Classic Match-3 logic. The player swaps adjacent blocks horizontally or vertically. * **Matching Logic**: * If 3 or more blocks of the same color align horizontally or vertically, they are destroyed ("blasted"). * **Gravity**: Remaining blocks above the destroyed ones must fall down (animate smoothly using linear interpolation/Lerp) to fill the gaps. New random blocks spawn at the top. * **Special Mechanic (Yin & Yang)**: * If a "Yin" or "Yang" block is included in a match, trigger a special effect (e.g., clear the entire row or column, or explode in a 3x3 radius). * **Scoring**: Award points for every block destroyed. Chain reactions (combos resulting from falling blocks) should award double points. * **Endless Mode**: The game continues indefinitely. The goal is to achieve the highest score possible. ### 4. Mobile Controls & Interaction * **Touch Input Handling**: Use the Three.js `Raycaster` to detect touch inputs on the 3D blocks. * *Touch Start*: Select the first block (highlight it with an emissive glow or slight scale up). * *Touch Move/Swipe*: Detect the direction of the finger movement (Up, Down, Left, Right) to initiate the swap with the adjacent block. * **Screen Adaptation**: * **Portrait Mode**: The grid should fit within the width of the screen with margins. * **UI Layout**: Place the Score counter at the top center and a "Reset" button at the bottom, ensuring they are outside the play area to prevent accidental clicks. * **Feedback**: * **Visual**: When a valid match occurs, play a particle explosion effect using `THREE.Points` before removing the blocks. * **Invalid Move**: If a swap results in no match, the blocks must animate back to their original positions (elastic bounce effect). Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Yin and Yang is a captivating match-3 puzzle game that puts a unique twist on the classic genre. Unlike traditional match-3 games that require exactly three matching pieces, this innovative puzzle allows you to match anywhere from three to unlimited cubes of the same color. With a current rating of 3.4/5, this colorful brain teaser offers both casual fun and strategic depth for puzzle enthusiasts.

The game features vibrant, candy-colored cubes arranged in a grid pattern. Your objective is to create horizontal or vertical lines of matching colored cubes to clear them from the board. As you progress, new rows of cubes continuously drop from above, creating an endless challenge that tests your speed, strategy, and pattern recognition skills.

Core Features

Flexible Matching System

Unlike rigid match-3 rules, Yin and Yang allows you to match any number of cubes - from the minimum of three up to massive chains spanning the entire board. This flexibility creates exciting combo opportunities and strategic depth.

Endless Gameplay

The game provides unlimited entertainment with continuously dropping cube rows. Each cleared match brings new challenges as the board refills with colorful blocks, ensuring no two gaming sessions are identical.

Cross-Platform Compatibility

  • Free to Play : Completely free with no hidden costs or premium content
  • Browser-Based : No downloads required - play instantly in any modern web browser
  • Mobile Optimized : Touch-friendly controls perfect for smartphones and tablets
  • HTML5 Technology : Smooth performance across all devices and platforms

Brain Training Benefits

This puzzle game serves as an excellent brain teaser, improving: - Pattern Recognition : Identify matching color sequences quickly - Strategic Thinking : Plan moves ahead to create larger combos - Hand-Eye Coordination : Develop faster reflexes and precision - Stress Relief : Enjoy relaxing, meditative gameplay

Gameplay Mechanics

The game combines the best elements of puzzle and action genres. You must think quickly to identify matching cubes while planning strategically for future moves. The continuous flow of new cubes creates a dynamic environment where adaptation and quick decision-making are key to success.

Scoring System

Larger matches yield higher scores, encouraging players to look for extensive color chains rather than just clearing minimum matches. This scoring mechanic adds depth and replayability as players strive to beat their personal best scores.

How to Play

Basic Controls

  • Mouse : Click and drag to select and move cube groups (desktop)
  • Touch : Tap and swipe to interact with cubes (mobile devices)
  • Selection : Choose any group of 3+ matching colored cubes
  • Direction : Matches can be horizontal or vertical only

Game Strategy

  1. Scan the Board : Quickly identify all possible matches before making moves
  2. Plan Ahead : Consider how clearing certain cubes will affect the board layout
  3. Create Combos : Look for opportunities to set up chain reactions
  4. Manage Speed : Balance quick clearing with strategic planning
  5. Focus on Large Groups : Prioritize bigger matches for higher scores

Winning Tips

  • Start by clearing cubes from the bottom to create cascading effects
  • Look for color patterns that repeat across the board
  • Don't rush - take time to identify the best possible match
  • Practice recognizing color combinations quickly
  • Use the falling cube patterns to your advantage

Why Play Yin and Yang

This match-3 puzzle game offers the perfect blend of accessibility and challenge. Whether you're a casual gamer looking for a few minutes of entertainment or a puzzle enthusiast seeking a brain-challenging experience, Yin and Yang delivers. The game's zen-like quality, combined with its strategic depth, makes it ideal for stress relief and mental exercise.

The flexible matching system sets it apart from other puzzle games, allowing for more creative gameplay and satisfying combo chains. With no time pressure in most modes, you can play at your own pace while still enjoying the excitement of cascading cube eliminations.

Perfect for All Skill Levels

Tagged as an "Easy" game, Yin and Yang is accessible to players of all ages and experience levels. The simple concept of matching colors is universally understood, while the strategic elements provide depth for more experienced puzzle gamers. This makes it an excellent choice for family gaming or personal relaxation time.

Frequently Asked Questions (FAQ)