Mini Train - Puzzle Track Building Game

Seele01-Flash
By
Mini Train is an engaging puzzle game where you help a colorful train reach its destination by strategically placing track pieces. Perfect for puzzle lovers of all ages with its intuitive drag-and-drop mechanics.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Mini Train - Physics Puzzle Builder". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** 2.5D "Toy Box" aesthetic. Use a fixed side-view camera (OrthographicCamera preferred) to simulate a flat 2D puzzle plane but with 3D depth. The art direction should match the vibrant, high-saturation cartoon style of the provided image (Yellow train, Red carriages, bright Blue background). * **Asset Details:** * **The Train:** A composite physics object consisting of a yellow chassis (chamfered box) and two black cylinder wheels. Connect wheels to the chassis using hinge constraints (Cannon.js or Ammo.js integration is required). * **The Track/Blocks:** Various geometric shapes (rectangles, triangles/ramps, squares) that look like wooden toy blocks. Give them a slight bevel to catch light. * **Background:** A dynamic "comic book" style background with a radial sunburst pattern (light blue and dark blue) that slowly rotates, similar to the reference image. * **Optimization:** Use low-poly primitives (BoxGeometry, CylinderGeometry) with `MeshStandardMaterial`. Enable simple directional lighting with soft shadows (`castShadow`, `receiveShadow`) to give the blocks a tactile, physical presence without killing mobile GPU performance. ### 2. Audio Requirements * **BGM:** A cozy, cheerful, and rhythmic track. Think "acoustic guitar + light percussion" or a "playful marching tune" that loops seamlessly. It should be relaxing enough for puzzle solving. * **Sound Effects (SFX):** * **Interaction:** A distinct wooden "Clack" or "Thud" when a block is dropped or hits another block. * **Train:** A classic steam whistle ("Choo-Choo!") when the Play button is pressed. A rhythmic "Chug-chug-chug" loop that plays only while the train is moving. * **Win/Loss:** A cheerful major-chord chime for success, and a comical "crash" or "spring boing" sound if the train topples over. ### 3. Gameplay Loop * **Phase 1: Build Mode (Paused State):** * The level presents a start platform (left) with the train and an end platform (right). There is a gap or obstacle in between. * "Loose" track pieces/blocks are scattered in the sky or on the side. * The train is static (physics kinematic or sleeping). * The player must drag and position the blocks to create a bridge or ramp. * **Phase 2: Action Mode (Simulation State):** * The player presses a large "PLAY" button. * The train's physics wake up, and a motor force is applied to the wheels. * The train attempts to drive over the player's constructed path. * **Win Condition:** The train physically touches a "Goal Trigger" on the right platform without tipping over (rotation Z must remain within a safe threshold). * **Lose Condition:** The train falls into the abyss (y < -10) or flips upside down. ### 4. Mobile Controls & Interaction * **Touch Handling:** Implement a Raycaster attached to `touchstart` and `touchmove` events. * **Drag & Drop:** Users can drag blocks freely in the X/Y plane. * **Rotation:** Implementing a "tap to rotate 45 degrees" or a multi-touch gesture to rotate blocks is essential for solving puzzles. * **UI Layout:** * **Play Button:** A large, green, circular "Play" triangle icon located in the bottom-right corner (min-size 64px for touch targets). * **Reset Button:** A refresh icon in the top-right to reset the train and blocks to their initial positions. * **Feedback:** * Highlight the selected block (emission material or outline) when the user touches it. * Trigger `navigator.vibrate(50)` (Haptic Feedback) when a block snaps into place or when the train starts moving. * **Orientation:** Force Landscape mode layout logic (even if the device is vertical, render the scene to fit the width). ### 5. Tech Stack Note * The code must include a physics engine (prefer **Cannon-es** or **Cannon.js**) to handle the vehicle constraints and block stacking collisions realistically. The train cannot just animate; it must drive using physics forces. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Mini Train

Mini Train is a delightful physics-based puzzle game that challenges your problem-solving skills while providing hours of entertainment. In this charming game, you become the master architect of railway tracks, helping a cheerful train navigate through increasingly complex levels. With its bright, colorful graphics and intuitive gameplay, Mini Train offers the perfect blend of challenge and relaxation.

Core Features

Interactive Track Building

The heart of Mini Train lies in its unique track construction mechanics. You'll find various track pieces scattered around each level, and your mission is to arrange them properly to create a safe path for the oncoming train. Each piece must be placed with precision to ensure the train can travel smoothly from start to finish.

Physics-Based Gameplay

What sets Mini Train apart is its realistic physics engine. The way you hold and rotate each track piece matters significantly. You'll need to consider angles, connections, and stability as you build the perfect railway route. The physics system adds depth to the puzzle-solving experience, making each level feel like a genuine engineering challenge.

Progressive Difficulty

Mini Train features carefully designed levels that gradually increase in complexity. Starting with simple straight tracks, you'll eventually work with curves, bridges, and multi-level constructions. Each new level introduces fresh challenges while building upon the skills you've already mastered.

Cross-Platform Accessibility

Whether you're at home or on the go, Mini Train adapts to your device. The game works seamlessly on desktop computers, tablets, and smartphones, ensuring you can enjoy puzzle-solving anywhere.

Game Mechanics

Mini Train operates on simple yet engaging mechanics that anyone can learn quickly:

  • Drag and Drop System : Use your mouse or finger to grab track pieces and move them across the screen
  • Rotation Controls : Hold pieces at different points to achieve the perfect angle for connections
  • Balance Consideration : Use arrow keys for fine-tuning piece placement and maintaining structural integrity
  • Testing Phase : Once you're satisfied with your track layout, hit the play button to test your creation

Operation Guide

Basic Controls

  • Mouse/Touch : Click and hold (or long-press on mobile) to grab track pieces
  • Drag : Move pieces across the screen to your desired location
  • Arrow Keys : Fine-tune placement and maintain balance of building blocks
  • Play Button : Start the train once your track is complete
  • Rotation : Hold pieces at different points to rotate them naturally

Success Strategy

  1. Analyze the Level : Before moving pieces, study the starting and ending points
  2. Plan Your Route : Visualize the path the train needs to take
  3. Start with Foundation : Place stable, straight pieces first
  4. Add Complexity : Gradually add curves and elevated sections
  5. Test and Adjust : Use the play button to test your track and make improvements

Why Play Mini Train

Perfect for All Ages

Mini Train strikes an excellent balance between challenge and accessibility. Children will love the colorful trains and simple mechanics, while adults can appreciate the strategic depth and physics-based puzzles. It's an ideal game for family gaming sessions.

Educational Value

Beyond entertainment, Mini Train offers educational benefits. Players develop spatial reasoning, problem-solving skills, and basic physics understanding. The game encourages logical thinking and planning, making it both fun and intellectually stimulating.

Stress-Free Gaming

Unlike action-packed games, Mini Train provides a relaxing gaming experience. There are no time limits or high-pressure situations – just you, the train, and the puzzle to solve. It's perfect for unwinding after a busy day.

No Barriers to Entry

As a completely free browser game, Mini Train removes all barriers between you and puzzle-solving fun. No downloads, no installations, no payment required – just pure gaming enjoyment accessible instantly through any web browser.

Frequently Asked Questions (FAQ)