Tangram Game - Classic Chinese Puzzle

Seele01-Flash
By
Tangram Game is a classic Chinese puzzle that challenges your spatial reasoning and geometry skills. Arrange seven geometric pieces to recreate various patterns and shapes in this timeless brain-training experience.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "**Tangram Master: Mythic Puzzle**". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** A "Zen" aesthetic inspired by traditional Chinese art (referencing the provided Monkey King screenshot). The background should be a soft, paper-textured beige or parchment style. * **Camera:** Use an `OrthographicCamera` positioned directly top-down to ensure accurate puzzle placement without perspective distortion. * **The Pieces (Tans):** Generate the standard 7 Tangram shapes using `THREE.ExtrudeGeometry` to give them slight 3D depth (wood or jade texture). * 2 Large Triangles * 1 Medium Triangle * 2 Small Triangles * 1 Square * 1 Parallelogram * **The Board:** A faint, dark silhouette (outline) of the target shape (e.g., a simplified Monkey King pose, a dragon, or a geometric animal) centered on the screen. * **Reward Asset:** Upon completing the puzzle, the silhouette should fade out and be replaced by a full-color texture plane showing the artwork (like the provided screenshot). ### 2. Audio Requirements * **BGM:** A calm, looping ambient track featuring traditional instruments like the Guzheng or Bamboo Flute to encourage focus. * **Sound Effects:** * **Pickup:** A soft "wood click" sound when a player touches a piece. * **Snap/Drop:** A satisfying "thud" when a piece snaps into the correct slot. * **Rotate:** A quick "swish" sound. * **Win:** A short traditional gong or chime flourish when the puzzle is solved. ### 3. Gameplay Loop * **Start:** The 7 pieces are scattered randomly on the edges of the screen (outside the silhouette area). * **Action:** * **Drag:** Player drags pieces into the silhouette. * **Snap System:** If a piece is released within a small threshold distance of its correct position and orientation, it automatically "snaps" (lerps) to the perfect coordinate and locks in place. * **Win Condition:** When all 7 pieces are snapped into their correct positions within the silhouette. * **Progression:** Show a "Level Complete" UI overlaid with the full-color artwork, then a button to load the next puzzle shape. ### 4. Mobile Controls & Interaction * **Touch Interaction (Raycaster):** Implement a robust `Raycaster` system mapped to `touchstart`, `touchmove`, and `touchend` events. * **Control Logic:** * **Drag:** Touch and hold a piece to move it on the X/Y plane. The piece should lift slightly (z-axis +0.5) to show it is active. * **Rotate:** A quick tap (duration < 200ms) on a piece rotates it 45 degrees clockwise. * **Screen Orientation:** Optimized for **Portrait Mode** (to mimic a book or scroll). * **UI Layout:** * Top Center: Level Title & Timer. * Bottom Right: A circular "Reset" button (minimum 44px touch target). * **Haptic Feedback:** Trigger a short vibration (`navigator.vibrate(20)`) when a piece snaps into the correct position. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Tangram Game is a digital version of the ancient Chinese puzzle that has captivated minds for over 1,000 years. This engaging brain teaser challenges players to arrange seven geometric pieces (called tans) to form specific patterns and silhouettes. With its simple concept yet complex solutions, Tangram offers endless entertainment while sharpening your spatial reasoning and problem-solving skills.

The game maintains the traditional essence of tangrams while providing the convenience of digital gameplay. Whether you're a puzzle enthusiast or someone looking to exercise your brain, this classic game delivers both challenge and satisfaction.

Core Features

Ancient Puzzle Tradition

Experience the timeless appeal of tangrams, a puzzle game that has entertained people across cultures for centuries. The seven geometric pieces can be arranged in countless ways to create recognizable shapes, animals, people, and abstract patterns.

Progressive Difficulty

Start with simple patterns and gradually work your way up to more complex designs. Each level presents a new silhouette to recreate, testing different aspects of your spatial intelligence and geometric understanding.

Interactive Gameplay

Enjoy smooth, responsive controls that make manipulating the tangram pieces intuitive and satisfying. The drag-and-drop interface combined with rotation mechanics provides precise control over piece placement.

Brain Training Benefits

Regular tangram play helps improve: - Spatial reasoning : Visualize how shapes fit together in space - Problem-solving skills : Develop systematic approaches to complex puzzles - Geometric understanding : Enhance awareness of shapes, angles, and proportions - Patience and persistence : Build focus through challenging mental exercises

Gameplay Mechanics

The objective is simple yet engaging: use all seven tangram pieces to perfectly fill a given outline or silhouette. Every piece must be used exactly once, and pieces cannot overlap. This constraint creates surprisingly complex challenges that require careful planning and creative thinking.

Each puzzle presents a black silhouette that you must recreate using the colored tangram pieces. The challenge lies in visualizing how the geometric shapes can be rotated, flipped, and arranged to match the target pattern exactly.

Operation Guide

Basic Controls

  • Click and Drag : Move tangram pieces around the game board
  • Click Corners : Rotate pieces to find the correct orientation
  • Drop Placement : Position pieces precisely within the target outline

Solving Strategy

  1. Analyze the Pattern : Study the target silhouette carefully to identify potential piece placements
  2. Start with Distinctive Shapes : Begin with easily recognizable areas like corners or unique angles
  3. Work Systematically : Try different orientations and positions methodically
  4. Think Geometrically : Consider how triangles, squares, and parallelograms can combine
  5. Be Patient : Complex patterns may require multiple attempts and creative thinking

Tips for Success

  • Look for familiar geometric relationships within the target shape
  • Remember that pieces can be flipped and rotated to any orientation
  • Focus on fitting pieces along the edges first, then fill in the center
  • Don't be afraid to move pieces you've already placed if they're blocking progress

Why Play Tangram Game

Educational Value

Tangrams are widely recognized as excellent educational tools. They help develop mathematical concepts including geometry, fractions, and spatial relationships. Teachers often use tangrams to make abstract mathematical concepts more concrete and understandable.

Stress Relief and Meditation

The focused concentration required for tangram solving provides a meditative quality that can help reduce stress and anxiety. The methodical process of arranging shapes creates a calming, mindful experience.

Universal Appeal

Tangrams transcend age, culture, and language barriers. From young children developing basic shape recognition to adults maintaining cognitive sharpness, this puzzle offers appropriate challenges for all skill levels.

No Time Pressure

Unlike many modern games, tangrams allow you to work at your own pace. There are no timers or penalties for taking your time to think through solutions, making it perfect for relaxed, contemplative gaming sessions.

Historical Connection

Playing tangrams connects you to a rich cultural tradition. This puzzle has been enjoyed by countless generations, creating a sense of continuity with mathematical and puzzle-solving traditions from ancient China.

Frequently Asked Questions (FAQ)