Bubble Sorting - Color Sorting Puzzle Game

Seele01-Flash
By
Bubble Sorting is an addictive color-matching puzzle game where you sort colorful bubbles into tubes. With 36 levels across three difficulty modes, it challenges your logical thinking and problem-solving skills.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Bubble Sorting**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Create a clean, "2.5D" aesthetic. Use a fixed camera angle (Orthographic or slight Perspective) so the gameplay feels flat and predictable, but the objects have depth and lighting. * **The Balls (Bubbles):** Use `THREE.SphereGeometry`. Apply a `MeshPhysicalMaterial` with high roughness and clearcoat to simulate a glossy "gumball" or polished plastic texture. Use high-contrast colors (Red, Blue, Green, Yellow, Cyan, Magenta, Orange) to ensure visibility on small screens. * **The Tubes:** Create cylindrical containers using `THREE.CylinderGeometry` (open top). Use a transparent material (`opacity: 0.3`, `transparent: true`, `transmission: 0.9` if supported) to simulate glass. Add a white ring torus at the top rim for visual clarity. * **Background:** Use a soft, neutral gradient (e.g., light grey to white) or a blurred, out-of-focus abstract pattern to avoid visual clutter. * **Effects:** When a ball is dropped, add a subtle "squash and stretch" animation or a small particle burst (confetti) when a tube is fully sorted with a single color. * **Optimization:** Use low-poly segments for cylinders (e.g., 32 segments) and spheres. Ensure textures are compressed. ### 2. Audio Requirements * **BGM:** A calm, Zen-like looping track (ambient or soft acoustic) that aids concentration and doesn't distract the player. * **Sound Effects (SFX):** * **Select:** A soft "pop" or suction sound when a ball is lifted. * **Drop:** A satisfying "clack" or "plop" (glass/plastic collision) when a ball lands in a tube. * **Invalid Move:** A dull "thud" or subtle buzzer sound when a player tries to move a ball to an incorrect color. * **Tube Complete:** A harmonic chime when a tube is successfully filled with one color. * **Win:** A celebratory fanfare or applause sound. ### 3. Gameplay Loop * **Level Generation:** Implement logic to generate levels based on difficulty. * *Easy:* 5 tubes, 3 colors (leaves 2 empty tubes). * *Medium:* 7 tubes, 5 colors. * *Hard:* 9 tubes, 7 colors. * **Crucial:** The shuffle algorithm must ensure the puzzle is *solvable*. * **Sorting Logic:** 1. Player selects a Source Tube (top ball pops up). 2. Player selects a Target Tube. 3. **Validation Rule:** A ball can only move if the Target Tube is empty OR if the top ball of the Target Tube matches the color of the moving ball. 4. If valid, animate the ball moving in an arc to the new tube. If invalid, the ball returns to the source. * **Win Condition:** The game is won when all tubes are either completely empty or contain 4 balls of the exact same color. * **Undo System:** Store the last 5 moves in an array. Provide an "Undo" function to reverse the last move. ### 4. Mobile Controls & Interaction * **Touch Input:** Use `Raycaster` for precise touch detection. * **Interaction Scheme (Tap-to-Move):** * *First Tap:* Selects a tube/ball (Visual feedback: The top ball levitates slightly above the tube). * *Second Tap:* Selects the destination tube. * *Tap Background:* Deselects the current ball. * **Orientation:** Force or design for **Portrait Mode** (vertical layout) to accommodate multiple tubes side-by-side on mobile screens. * **UI Layout:** * Place the **Undo Button** and **Restart Button** at the bottom of the screen (thumb-accessible zone). Button size must be at least 44x44px. * Display "Level" and "Difficulty" at the top. * **Feedback:** * **Visual:** Highlight valid target tubes with a subtle glow or outline when a ball is selected. * **Haptic:** Trigger a light vibration (`navigator.vibrate(10)`) on successful moves if the device supports it. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Bubble Sorting is a captivating logic puzzle game that combines simple mechanics with increasingly challenging gameplay. Your mission is straightforward yet engaging: sort colorful bubbles into separate tubes so each tube contains only one color. This deceptively simple concept creates hours of brain-teasing entertainment that will test your strategic thinking and planning abilities.

The game features beautiful, vibrant bubble graphics and smooth animations that make the sorting process visually satisfying. Each bubble has a distinct, glossy appearance that makes color identification easy and enjoyable.

Core Features

Three Progressive Difficulty Levels

Bubble Sorting offers carefully designed difficulty progression: - Easy Mode : 5 tubes with 3 colors - perfect for beginners - Medium Mode : 7 tubes with 5 colors - increased complexity - Hard Mode : 9 tubes with 7 colors - ultimate challenge

Extensive Content

With 36 unique levels (12 per difficulty), you'll have plenty of content to master. Each level presents a new arrangement that requires fresh thinking and strategy.

Forgiving Gameplay Mechanics

Every level includes 5 undo moves , allowing you to reverse decisions and experiment with different strategies without penalty. This feature encourages experimentation and reduces frustration.

Cross-Platform Compatibility

Play seamlessly on any device - desktop computers, tablets, or smartphones. The game automatically adapts to your screen size for optimal gameplay experience.

Game Mechanics

Strategic Sorting Rules

The core challenge lies in the sorting restrictions: you cannot place bubbles of different colors directly next to each other. This rule forces you to think several moves ahead, creating engaging puzzle scenarios that require careful planning.

Progressive Challenge System

As you advance through difficulties, you'll encounter: - More tubes to manage - Additional colors to sort - Complex starting arrangements - Increased need for strategic thinking

How to Play

Basic Controls

Mouse Controls : Simply click on a bubble to select it, then click on the destination tube. The intuitive point-and-click interface makes gameplay accessible to players of all ages.

Winning Strategy

Success requires: 1. Planning ahead : Consider the consequences of each move 2. Color management : Keep track of which colors need sorting 3. Tube optimization : Use empty tubes strategically as temporary storage 4. Undo utilization : Don't hesitate to use your 5 undo moves for experimentation

Why Play Bubble Sorting

Perfect Brain Training

This game excellently develops: - Logical reasoning through strategic planning - Visual processing via color recognition and spatial awareness - Problem-solving skills through puzzle completion - Patience and persistence as levels increase in complexity

Stress-Free Gaming

Unlike time-pressure games, Bubble Sorting allows you to: - Think at your own pace - Plan moves carefully - Enjoy a relaxing, meditative gaming experience - Take breaks without losing progress

Accessibility Features

  • No time limits - play at your comfortable pace
  • Clear visual design - easy color distinction
  • Simple controls - accessible to all skill levels
  • Free to play - no hidden costs or premium features

Educational Value

Bubble Sorting serves as an excellent educational tool for: - Children : Developing color recognition and logical thinking - Adults : Maintaining cognitive sharpness and problem-solving abilities - Seniors : Engaging in mentally stimulating activities

Frequently Asked Questions (FAQ)