Looking at this task, I need to build a curling game with realistic physics. Let me plan the architecture:
Approach:
- Canvas 2D for smooth physics rendering (top-down view)
- Physics model: constant friction deceleration (μ ≈ 0.0168 on real ice), reduced during sweeping, subtle curl based on stone rotation
- Controls: drag-to-aim slingshot mechanic for power+direction, plus curl direction selector
- Game flow: 2 teams × 4 stones each, alternate turns, standard "end" scoring
- Sweeping: hold button while stone slides → friction halved, curl dampened
Let me start by exploring the project and then building.
Now I'll update the title and create the full curling game. I'll put everything in App.tsx for simplicity but organize it cleanly with a separate physics helper.
Now I'll build the main curling game. This is a comprehensive implementation covering physics, rendering, input, and game logic:
I need to clean up the unused declarations:
Now let me build the project to verify everything compiles:
The build succeeded. Here's what I built:
🥌 Curling: Slide & Sweep
Physics engine (Canvas 2D):
- Realistic ice friction: Constant deceleration model (a = -μg) tuned so full-power throws land at the house
- Curl: Lateral acceleration perpendicular to velocity, direction set by in-turn/out-turn rotation. A real curling stone curves ~1m over the sheet — this does the same
- Sweeping: Hold button → friction cut 55% (stone travels ~2× farther) AND curl dampened 75% (straighter path). Matches real physics — sweepers melt the pebble
- Collisions: Equal-mass elastic stone-stone impacts with 0.96 restitution, proper separation, and normal-axis impulse resolution
- Boundary removal: Stones leaving sides or crossing back line are out
Gameplay:
- Slingshot aiming: Drag from the stone — pull direction = throw direction, pull length = power
- Live trajectory preview: Dotted path shows predicted curve including curl effect
- Color-coded power meter (blue/green/red)
- In-turn / Out-turn buttons for curl direction
- Hold-to-sweep button with animated broom + ice particle spray
- Hog-line rule: Stone must pass the far hog line or it's removed
- 8 stones, alternating red/yellow
Scoring (standard curling rules):
- After all 8 stones: team closest to the button scores
- One point per stone closer than opponent's nearest
- Blank end detection, cumulative scoring, "Play Another End"
Polished UI: Top-down sheet with proper markings (12ft/8ft/4ft/button rings, center line, tee line, two hog lines, back line, hack), 3D-styled stones with gradient body + colored cap + handle, scoreboard with active-team highlight, status panel, and collapsible how-to-play guide.
Files built: index.html, src/App.tsx