Nuts Puzzle: Sort By Color

Seele01-Flash
By
Nuts Puzzle: Sort By Color is a challenging logic puzzle game where you organize colored nuts onto screws by matching colors. Perfect for testing your strategic thinking and problem-solving skills.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Nuts Puzzle: Sort By Color". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Create a stylized, semi-realistic look with high color saturation. Use a clean, gradient background (Dark Blue to Light Blue/White) similar to a studio backdrop to make the game pieces pop. * **Models:** * **Screws:** Vertical metallic cylinders with a texture or normal map indicating "threads". Base should be a hex-bolt head. * **Nuts:** Hexagonal shapes (CylinderGeometry with 6 radial segments) with a hole in the center. They must be stackable. * **Colors:** Use distinct, vibrant colors for the nuts (Red, Blue, Green, Yellow) and a Silver/Grey metallic material for the screws. * **Mobile Optimization:** Use `THREE.InstancedMesh` for the nuts if possible, or low-poly geometries to ensure 60fps on mobile devices. Use simple directional lighting with cast shadows for depth, plus an ambient light. ### 2. Audio Requirements * **BGM:** A relaxing, lo-fi or soft jazz instrumental track that loops seamlessly. It should aid concentration without being repetitive. * **Sound Effects (SFX):** * **Select:** A subtle metallic "click" or "pop" when a nut is tapped/lifted. * **Move/screw:** A mechanical "whir" or rapid metallic clicking sound as the nut travels down the screw. * **Invalid Move:** A dull "thud" or buzzer sound/shake effect. * **Win/Level Complete:** An upbeat chime or fanfare with a particle confetti explosion sound. ### 3. Gameplay Loop * **Data Structure:** Represent the game state as an array of arrays (stacks), where each sub-array contains the color IDs of the nuts on that screw. * **Mechanics:** * **Tap to Select:** Player taps a screw. If it has nuts, the top nut lifts up (animation) to indicate selection. * **Tap to Drop:** Player taps a target screw. * **Validation Logic:** The move is valid ONLY if: 1. The target screw is empty OR the top nut of the target screw matches the color of the selected nut. 2. The target screw has not reached maximum capacity (e.g., max 4 nuts). * **Win Condition:** The level is complete when all screws are either empty or full of nuts of a single uniform color. * **Helpers:** Implement logic for an "Undo" button (reverses last move) and a "Restart" button. ### 4. Mobile Controls & Interaction * **Touch Controls:** Use `THREE.Raycaster` mapped to touch events (`touchstart`). * **Selection Feedback:** When a nut is selected, it should visually lift up slightly (Y-axis tween) and hover. * **Target Highlights:** Valid target screws should have a subtle glow or outline when a nut is currently selected. * **Animation:** When moving, use a Tweening library (like GSAP) to animate the nut moving horizontally to the new screw, then rotating (spinning) as it descends, simulating being screwed on. * **Responsiveness:** * **Camera:** Implement an Orthographic Camera or Perspective Camera that auto-adjusts its Zoom/FOV based on the screen aspect ratio. Ensure the game is playable in both Portrait (preferred) and Landscape modes without cutting off the outer screws. * **UI:** Place "Undo" and "Reset" buttons at the bottom of the screen (safe zone) with a minimum touch target size of 44x44px. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Nuts Puzzle: Sort By Color is an engaging logic puzzle game that challenges players to organize colorful nuts onto screws until each screw contains nuts of only one color. This deceptively simple concept creates increasingly complex puzzles that will test your strategic thinking and planning abilities.

The game features a clean, intuitive interface with vibrant 3D graphics that make the sorting process visually satisfying. As you progress through levels, you'll encounter more colors, additional screws, and clever obstacles that require careful consideration of every move.

Core Features

Progressive Difficulty System

Start with simple 3-color puzzles and advance to complex challenges featuring multiple colors and intricate arrangements. Each level is carefully designed to introduce new strategic elements while building on previously learned concepts.

Smart Helper System

When you find yourself stuck, the game provides helpful tools: - Undo Function : Reverse your last move to try a different approach - Reset Option : Start the level fresh if you need a complete do-over - Extra Screw : Add additional space when puzzles become too constrained

Reward System

Earn rewards through successful puzzle completion and use the winner's wheel to unlock additional helpers. The game encourages efficient solving by tracking your move count and completion time.

Hard Mode Challenges

Advanced levels introduce hidden colors that are only revealed when you move nuts from above them, adding an extra layer of strategy and memory challenge.

Gameplay Mechanics

Basic Rules

The core gameplay follows simple yet strategic rules: - Tap a nut to select it, then choose the destination screw - Nuts can only be placed on empty screws or on screws where the top nut matches the selected nut's color - Complete each level by organizing all nuts so each screw contains only one color

Strategic Planning

Success requires thinking several moves ahead. Consider: - Which nuts are blocking access to others - How to create temporary storage space - The optimal sequence for clearing mixed-color screws - When to use limited helper tools

How to Play

Getting Started

  1. Select a Nut : Click on any nut you want to move
  2. Choose Destination : Click on the screw where you want to place it
  3. Follow Color Rules : Only place nuts on empty screws or matching colors
  4. Plan Ahead : Think about the consequences of each move
  5. Complete the Sort : Organize until each screw has only one color

Advanced Tips

  • Work backwards from your goal - identify which nuts need to move first
  • Use empty screws strategically as temporary storage
  • Don't rush - taking time to plan prevents getting stuck
  • Save helper tools for the most challenging situations

Platform Support

Nuts Puzzle: Sort By Color is designed for universal accessibility: - Web Browsers : Play instantly on desktop and mobile browsers - Cross-Device Compatibility : Seamless experience across all screen sizes - No Download Required : Start playing immediately without installation - Touch and Mouse Support : Optimized controls for both mobile and desktop

Why Play This Game

This puzzle game offers the perfect balance of relaxation and mental challenge. The satisfying click-and-sort mechanics provide immediate feedback, while the strategic depth keeps you engaged for hours. Whether you're looking for a quick brain teaser during a break or a longer puzzle-solving session, Nuts Puzzle: Sort By Color adapts to your playing style.

The game's clean design and intuitive controls make it accessible to players of all ages, while the increasing difficulty ensures long-term engagement. Each successfully completed level provides a genuine sense of accomplishment and progress.

Frequently Asked Questions (FAQ)