Bubble Sorting - Color Puzzle Game

Seele01-Flash
By
Bubble Sorting is an engaging color-sorting puzzle game that challenges your logical thinking. Move colorful bubbles into tubes to group them by color, with strategic planning and problem-solving skills.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Bubble Sorting 3D". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** Clean, glossy, and minimalist 3D aesthetic. The scene should look like a high-end puzzle game. * **Tubes (Containers):** Create `CylinderGeometry` tubes with a transparent, glass-like material (use `MeshPhysicalMaterial` with transmission and roughness settings to simulate glass). They should have a solid rim at the top. * **Bubbles (Balls):** Use `SphereGeometry` for the balls. They must be highly reflective and glossy (plastic or polished marble look). Use distinct, vibrant colors (Red, Cyan, Orange, Purple, Green). * **Lighting:** Use a 3-point lighting setup. An `AmbientLight` for base visibility and a strong `DirectionalLight` to create specular highlights (shininess) on the balls and glass tubes. * **Background:** A soft, off-white or light grey gradient background to maintain contrast with the colorful balls. * **Optimization:** Use `InstancedMesh` for the balls if possible to reduce draw calls, or keep segment counts moderate (e.g., 32 segments) for mobile performance. ### 2. Audio Requirements * **BGM:** A calm, Zen-like, lo-fi or ambient electronic track that encourages thinking and logic. It should be unobtrusive and loop seamlessly. * **Sound Effects (SFX):** * **Select:** A soft "pop" or suction sound when a ball is lifted from a tube. * **Drop/Move:** A satisfying "clink" or hollow glass tap sound when the ball lands in a new tube. * **Invalid Move:** A dull "thud" or a gentle vibration sound. * **Undo:** A "whoosh" reverse sound. * **Level Complete:** A cheerful, rising arpeggio or chime sequence. ### 3. Gameplay Loop * **Initialization:** Generate a specific number of tubes (e.g., 4 to 6). Fill most tubes with 4 mixed-colored balls each, leaving 2 tubes empty. * **Logic Rules:** 1. The player can only move the **top-most** ball from a tube. 2. A ball can only be moved into a tube if the tube is **empty** OR if the top ball in the target tube is the **same color**. 3. A tube can hold a maximum of 4 balls. * **Win Condition:** The level is won when all tubes are either completely empty or contain 4 balls of the exact same color. * **Undo System:** Implement a "Stack" data structure to record the last 5 moves. Provide a button to reverse the state. ### 4. Mobile Controls & Interaction * **Orientation:** Force or optimize for **Portrait Mode** (Vertical) to accommodate the height of the test tubes and allow one-handed play. * **Touch Input:** * Use `Raycaster` for touch detection. * **Tap 1:** Select a tube. The top ball should animate (float upwards) out of the tube to indicate selection. * **Tap 2:** Tap a target tube. The floating ball travels in a smooth arc (Parabolic path) to the new tube. * **Deselect:** Tapping the same tube again or the background should cancel the selection and drop the ball back. * **UI Layout:** Place the "Undo" button and "Restart" button at the bottom of the screen (Thumb Zone) with a minimum touch target size of 48x48px. * **Feedback:** When a move is invalid, the selected ball should shake briefly (visual feedback) and return to its original spot. Add `navigator.vibrate(50)` for haptic feedback on successful drops. 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 puzzle game that combines color recognition with logical problem-solving. Your mission is simple yet challenging: sort colorful bubbles by moving them into different tubes until each tube contains only one color. This brain-teasing game requires strategic thinking, as you cannot place two different colored bubbles directly next to each other.

The game features vibrant, eye-catching graphics with smooth animations that make the sorting process visually satisfying. Each level presents a new puzzle configuration, keeping the gameplay fresh and engaging.

Core Features

Strategic Puzzle Mechanics

The game's core challenge lies in its restriction system. You cannot place bubbles of different colors adjacent to each other, forcing you to think several moves ahead. This creates a chess-like strategic depth where every move matters.

Undo System

Each level provides 5 chances to reverse your decisions. If you make a mistake or change your strategy, you can put bubbles back where they came from, encouraging experimentation without fear of failure.

Adjustable Difficulty

Customize your experience with multiple difficulty settings. Whether you're a beginner looking for a relaxing puzzle experience or an expert seeking mind-bending challenges, there's a perfect mode for you.

Progressive Challenge System

As you advance through levels, the puzzles become increasingly complex with more colors, tubes, and bubbles to manage. This gradual difficulty curve ensures a satisfying learning experience.

Game Playstyle

Visual Learning and Pattern Recognition

Bubble Sorting enhances your ability to recognize patterns and visualize sequences. Players develop better spatial reasoning and color coordination skills through gameplay.

Stress-Free Environment

Unlike time-pressured games, Bubble Sorting allows you to think at your own pace. This makes it perfect for relaxation while still providing mental stimulation.

Operation Guide

The controls are intuitive and accessible:

  • Select a Bubble : Click or tap on any movable bubble to select it
  • Move to Tube : Click or tap on your desired destination tube to drop the bubble
  • Undo Move : Use your 5 available undo chances if you need to reverse a decision
  • Difficulty Adjustment : Access settings to change difficulty levels at any time

The game responds smoothly to both mouse clicks on desktop and touch gestures on mobile devices, ensuring a seamless experience across all platforms.

Why Play This Game

Mental Exercise : Bubble Sorting provides excellent brain training, improving logical thinking, planning skills, and problem-solving abilities. It's like a gym workout for your mind.

Accessibility : Being completely free and browser-based, you can enjoy this game anywhere without downloads or installations. It works perfectly on computers, tablets, and smartphones.

Relaxing Yet Challenging : The game strikes the perfect balance between being mentally stimulating and stress-relieving. The colorful visuals and satisfying sorting mechanics create a meditative gaming experience.

Educational Value : Teachers and parents appreciate this game for its educational benefits, helping develop critical thinking skills in an entertaining format.

Perfect for All Ages : The simple concept makes it accessible to children, while the strategic depth keeps adults engaged. It's an ideal family-friendly puzzle game.

Frequently Asked Questions (FAQ)