# 🦤 Flappy DODO - Pitch Singing Game

A visually stunning, highly polished pitch-singing game built with React. Players control a bird by singing or pressing keys, navigating through obstacles in a fast-paced musical challenge.

**Part of the Suno Music Adventure RPG** - Accessible from the Arcade (🕹️) button. Rewards 100 Suno Credits on completion.

## Features

### 🎮 Game Modes
- **Keyboard Mode**: Press 1-7 keys for musical notes (C-D-E-F-G-A-B)
- **Vocal Mode**: Sing to make the bird jump (requires pitch detection)

### 🎯 Difficulty Levels
- **Easy (15s)**: Wider gaps, slower progression
- **Hard (15s)**: Narrower gaps, faster progression  
- **Easy (60s)**: Gradual difficulty increase over 60 seconds
- **Hard (60s)**: Aggressive difficulty curve

### ✨ Visual Polish
- **Particle Systems**: Jump particles, fence pass celebrations, death explosions
- **Screen Effects**: Screen shake on collisions, dynamic backgrounds
- **Smooth Animations**: Bird rotation, score counters, combo indicators
- **Gradient Themes**: Color shifts based on game speed and state

### 📊 Gameplay Features
- Progressive difficulty (fences spawn faster over time)
- Combo system for consecutive successes
- High score tracking (localStorage)
- Real-time HUD with score, time, and combo

## File Structure

```
FlappyDODO/
├── FlappyDODO.js           # Main orchestrator
├── FlappyDODO.css          # Styling
├── index.js                # Export
├── README.md               # This file
│
├── components/
│   ├── GameCanvas.js       # Main render area
│   ├── Bird.js             # Bird sprite
│   ├── Fence.js            # Obstacle rendering
│   ├── ParticleSystem.js   # Particle effects
│   ├── Background.js       # Dynamic background
│   └── HUD.js              # Heads-up display
│
├── hooks/
│   ├── useGameLoop.js      # 60fps game loop
│   ├── useGameState.js     # State management
│   ├── useKeyInput.js      # Keyboard controls
│   └── useParticles.js     # Particle system
│
├── utils/
│   ├── constants.js        # Game configuration
│   ├── gamePhysics.js      # Physics calculations
│   ├── collisionDetection.js
│   ├── particleEffects.js
│   └── animations.js       # Easing functions
│
└── __tests__/              # Comprehensive test suite
    ├── FlappyDODO.test.js
    ├── hooks/
    │   └── useGameLoop.test.js
    └── utils/
        ├── gamePhysics.test.js
        ├── collisionDetection.test.js
        └── particleEffects.test.js
```

## How to Play

### Keyboard Mode
1. Select "Keyboard" input mode
2. Choose a difficulty level
3. Press keys 1-7 to jump and match notes on fences:
   - 1 = C
   - 2 = D
   - 3 = E
   - 4 = F
   - 5 = G
   - 6 = A
   - 7 = B
4. Navigate through gaps without hitting fences
5. Survive until the timer runs out to win!

### Vocal Mode (Future)
1. Select "Vocal" input mode
2. Allow microphone access
3. Sing/hum to make the bird jump
4. Higher pitch = stronger jump

## Game Physics

- **Bird Movement**: Constant horizontal movement (3px/frame) from left to right
- **Gravity**: Constant downward force (0.4-0.6 depending on difficulty)
- **Jump**: Upward velocity burst (-8 to -10 depending on difficulty)
- **Collisions**: 
  - Hit fence = Game Over
  - Miss gap = Game Over
  - Hit boundary = Game Over
  - Wrong note (keyboard mode) = Game Over

## Testing

Run tests with:
```bash
npm test FlappyDODO
```

Test coverage includes:
- Component rendering
- Game loop mechanics
- Physics calculations
- Collision detection
- Particle effects

## Performance

- Optimized for 60fps gameplay
- Efficient particle pooling
- Minimal re-renders using React hooks
- Smooth animations with requestAnimationFrame

## Future Enhancements

- [ ] Pitch detection implementation (Web Audio API)
- [ ] Audio recording and playback
- [ ] Share card generation
- [ ] Suno integration for cover creation
- [ ] Background music with intensity layers
- [ ] Sound effects (jump, pass, collision)
- [ ] Tutorial overlay for first-time players
- [ ] Pause functionality
- [ ] Bird skins/cosmetics
- [ ] Leaderboards

## Configuration

Edit `utils/constants.js` to customize:
- Canvas dimensions
- Bird physics parameters
- Difficulty configurations
- Color palette
- Musical note frequencies

## Credits

Built with ❤️ for Tony's Dev Tunes
Inspired by Flappy Bird and musical rhythm games

