|
| 1 | +# Vite + React Template Knowledge |
| 2 | + |
| 3 | +## Project Overview |
| 4 | +A fish tank simulation with swimming fish, predator behavior, and interactive elements. |
| 5 | + |
| 6 | +## Key Features |
| 7 | +- Fish swim with natural movement patterns |
| 8 | +- Fish speed up to escape when predators are nearby |
| 9 | +- Predators chase nearest prey |
| 10 | +- Collision detection between creatures |
| 11 | +- Death animations for caught fish |
| 12 | + |
| 13 | +## Animation Guidelines |
| 14 | +- Use CSS transitions for smooth movement |
| 15 | +- Use 3D transforms for depth: |
| 16 | + - Container needs perspective: 2000px |
| 17 | + - Container needs transform-style: preserve-3d |
| 18 | + - Fish: ±200px depth, fast cycle |
| 19 | + - Shark: ±300px depth, medium cycle |
| 20 | + - Whale shark: ±400px depth, slow cycle |
| 21 | +- Scale with depth for more dramatic effect: |
| 22 | + - Fish: ±10% scale |
| 23 | + - Shark: ±15% scale |
| 24 | + - Whale shark: ±20% scale |
| 25 | +- Use rotateY instead of scaleX for direction changes |
| 26 | +- Remove transitions for immediate reactions to events |
| 27 | +- Add depth to environment: |
| 28 | + - Use transparent gradient layers in background |
| 29 | + - Animate container with subtle 3D movement |
| 30 | + - Create parallax effect with container animation |
| 31 | +- Death animation sequence: |
| 32 | + 1. Fish straightens out when shark attacks |
| 33 | + 2. When shark moves away, fish flips upside down |
| 34 | + 3. After 500ms, transforms to skull (☠️) and starts fading |
| 35 | + 4. Completes fade out over next 500ms |
| 36 | +- Scale emojis for different creature sizes |
| 37 | + |
| 38 | +## Combat Mechanics |
| 39 | +- Shark must be moving towards fish to attack (within 30px range) |
| 40 | +- Fish speed increases based on distance to shark using quadratic easing |
| 41 | +- Whale shark protects fish by pushing shark away when nearby |
| 42 | + |
| 43 | +## Game Balance |
| 44 | +- Base fish speed: 0.5 units (slow peaceful swimming) |
| 45 | +- Shark speed: 3 units (fast predator) |
| 46 | +- Whale shark speed: 4 units (fast enough to catch shark) |
| 47 | +- Fish speed multiplier: gradually increases up to 2x within 200px of shark |
| 48 | +- Protection distances: |
| 49 | + - Shark catching fish: 15px (must be within 15 degrees of directly facing fish) |
| 50 | + - Whale shark slaps shark away 250px when within 100px range |
| 51 | + |
| 52 | +## Verifying changes |
| 53 | +After every change, run: |
| 54 | +```bash |
| 55 | +npm run lint && npm run typecheck |
| 56 | +``` |
| 57 | +This will check for lint issues and type errors. |
0 commit comments