Bridge Builder - Physics-Based Bridge Construction Game

Seele01-Flash
By
Bridge Builder is an engaging physics-based puzzle game where you design and construct bridges using limited materials. Test your engineering skills by creating structures strong enough for vehicles to cross safely.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Bridge Builder". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: A clean, "2.5D" stylized aesthetic. Use 3D geometry but lock the camera to an Orthographic side view to simplify construction logic while maintaining depth. * **Key Models**: * **Terrain**: Low-poly riverbanks on the left and right sides. * **Water**: A simple, animated shader plane (blue with slight white noise) representing the river below. * **Bridge Parts**: * *Nodes*: Small spheres representing joints. * *Beams*: Cylinders connecting nodes. Use color coding: Wood (brown), Steel (gray/metallic), Cables (thin black lines). * *Road Deck*: Flattened cubes for the vehicle surface. * **Vehicle**: A low-poly red truck or sedan. * **Visual Feedback (Stress)**: Implement a dynamic material system where beams change color from Green (safe) to Red (high stress) during simulation based on tension/compression load. * **Mobile Optimization**: Use a shared geometry approach (InstancedMesh) for bridge segments and nodes to reduce draw calls. Keep shadow maps simple (one directional light). ### 2. Audio Requirements * **BGM**: A relaxing, acoustic guitar or light piano track that loops seamlessly during the "Build Phase" to encourage thinking. * **SFX**: * **UI/Interaction**: A satisfying metallic "click" or "snap" sound when connecting nodes. * **Simulation**: A "creaking metal" sound that increases in volume as bridge stress rises. * **Success**: A cheerful chime and engine revving sound when the car reaches the finish. * **Fail**: A loud "crunch" followed by a water splash sound if the bridge collapses. ### 3. Gameplay Loop * **Phase 1: Blueprint/Build Mode**: * The physics simulation is paused. * The player starts with fixed anchor points on the terrain banks. * **Resource Management**: A budget counter decreases as materials are placed. * **Logic**: Players draw lines between nodes. The game must enforce a maximum length per beam (prevent infinite stretching). * **Structure**: Supports triangulation (Y-shapes, triangles) for stability. * **Phase 2: Simulation Mode**: * Triggered by a "Play" button. Gravity is enabled. * **Physics Engine**: Use a Verlet Integration system or a rigid body physics engine (like Cannon.js) to simulate constraints. * **Stress Test**: If the force on any connection exceeds a defined threshold, the bond breaks, causing a chain reaction. * **Win Condition**: The vehicle successfully traverses from the start bank to the finish bank without touching the water. * **Fail Condition**: The bridge collapses, or the vehicle falls into the water (Y-axis < Water Level). ### 4. Mobile Controls & Interaction * **Screen Orientation**: Landscape mode locked. * **Touch Building Controls**: * **Draw**: Touch and drag from an existing node to create a new beam. * **Magnetic Snap**: When dragging near an existing node or grid point, the cursor must "snap" to it (crucial for mobile precision). * **Delete**: Double-tap a beam or node to remove it (as per original description), or provide a toggleable "Eraser Mode" button in the UI. * **Camera**: Two-finger pinch to zoom, two-finger drag to pan the view. * **UI Layout**: * **Top Right**: Budget counter and Menu. * **Bottom Center**: Material palette (Wood, Steel, Cable) - buttons must be at least 44x44px. * **Bottom Right**: A large, green "Play/Simulate" triangle button. * **Bottom Left**: A large "Undo" arrow button. * **Haptic Feedback**: Trigger a light vibration when a node successfully snaps/connects. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About Bridge Builder

Bridge Builder is a captivating physics-based puzzle simulation game that puts your engineering and architectural skills to the ultimate test. In this challenging simulator, you become the chief architect responsible for designing and constructing bridges that can safely transport vehicles across various terrains including rivers, canyons, and mountain ranges.

The game combines realistic physics mechanics with strategic resource management, creating an immersive experience that's both educational and entertaining. With limited materials at your disposal, every decision matters as you work to create structurally sound bridges that can withstand the weight and movement of crossing vehicles.

Core Features

Realistic Physics Engine

Experience authentic structural engineering challenges with a sophisticated physics system that accurately simulates weight distribution, stress points, and structural integrity. Watch your creations come to life as vehicles test the limits of your engineering prowess.

Resource Management Challenge

Work with limited materials including metal planks and support beams. Strategic planning is essential as you must maximize the effectiveness of each piece while staying within budget constraints.

Progressive Difficulty System

Start with simple city bridges and unlock increasingly complex environments including: - Waterfall crossings with rushing water below - Deep canyons requiring long-span solutions - Mountain ranges with challenging elevation changes - Urban environments with space limitations

Multiple Construction Strategies

Explore various engineering approaches: - Y-shaped support structures for maximum stability - Triangle-based designs for distributed weight support - Suspension bridge concepts using cables and vertical supports - Creative hybrid solutions combining multiple techniques

Built-in Tutorial and Hint System

Never get stuck with the comprehensive tutorial system and on-demand hints that can either show you the solution or guide you through the construction process step-by-step.

Gameplay Mechanics

Construction Phase

Drag and drop metal components from available circles, extending and positioning them to create your bridge structure. Each piece can be customized in length and angle to fit your design vision.

Testing Phase

Once your bridge is complete, press the play button to release a vehicle that will attempt to cross your construction. Success means safe passage; failure sends you back to redesign and rebuild.

Error Correction

Made a mistake? Simply double-tap any piece to remove it and try a different approach. The game encourages experimentation and learning from failures.

Operation Guide

Mouse Controls: - Left Click + Drag : Place and position bridge components - Double-click : Remove unwanted pieces - Space Bar : Start the vehicle simulation test - Z Key : Undo the last action

Construction Tips: - Always ensure strong foundation support on both sides - Consider weight distribution when planning your design - Test different structural approaches if your first attempt fails - Use triangular supports for maximum stability - Plan your material usage carefully to avoid running out

Why Play Bridge Builder

Educational Value : Learn fundamental engineering and physics principles through hands-on construction challenges that mirror real-world bridge building concepts.

Creative Problem-Solving : Each level presents unique challenges that require innovative thinking and multiple solution approaches, encouraging creativity within practical constraints.

Immediate Feedback : The physics simulation provides instant results, allowing you to quickly understand what works and what doesn't in bridge construction.

Progressive Challenge : Starting with simple constructions and advancing to complex multi-terrain bridges ensures continuous learning and engagement.

Free and Accessible : Play directly in your browser without downloads, making it perfect for quick engineering challenges or extended building sessions.

Stress-Free Learning Environment : Failure is part of the learning process, with unlimited attempts to perfect your designs without real-world consequences.

Frequently Asked Questions (FAQ)