# Face Invaders - Android Game

A professional Space Invaders-style Android game where you shoot faces of politicians instead of aliens!

## Features

✅ **Gameplay**
- Touch controls: Left, Right, Fire buttons
- 4 waves of enemies with increasing difficulty
- Boss ship (Donald Trump) appears every 12 seconds worth 500 points
- Combo/streak scoring multiplier
- Persistent high score tracking

✅ **Dynamic Face Gallery**
- In-app menu to load your own images from device
- Faces are stored persistently (survive app restarts)
- 20 pre-loaded politician faces included in APK

✅ **Audio & Effects**
- Procedural audio generation (no external files)
- Ambient looping music
- SFX for shooting, explosions, hits, game over
- Particle explosion effects

✅ **Professional UI**
- Start menu with face configuration
- Game over screen with play again option
- Wave counter and combo display
- High score display

## How to Build APK

### Option 1: GitHub Actions (Recommended)

1. **Create GitHub Repository**
   ```bash
   # From the project directory
   git remote add origin https://github.com/YOUR_USERNAME/face-invaders.git
   git branch -M main
   git push -u origin main
   ```

2. **Add Secrets to GitHub**
   - Go to Settings → Secrets and variables → Actions
   - Add these secrets (leave empty if using free license):
     - `UNITY_LICENSE` (optional - for free tier)
     - `UNITY_EMAIL` (optional)
     - `UNITY_PASSWORD` (optional)

3. **Wait for Build**
   - GitHub Actions will automatically build when you push
   - Download APK from Actions artifacts
   - Or create a Release tag to auto-generate releases

### Option 2: Local Build (if you have Unity installed)

1. Open Unity Hub
2. Open this project
3. File → Build Settings → Android
4. Click "Build" and choose output location
5. Wait 5-15 minutes for compilation

## Project Structure

```
JU/
├── Assets/
│   ├── Scripts/
│   │   ├── GameManager.cs          - Core game loop & state
│   │   ├── PlayerController.cs     - Player movement & firing
│   │   ├── Enemy.cs                - Enemy behavior
│   │   ├── BossShip.cs             - Boss UFO logic
│   │   ├── Bullet.cs               - Projectile behavior
│   │   ├── AudioManager.cs         - Procedural audio
│   │   ├── ExplosionEffect.cs      - Particle effects
│   │   ├── ImageGalleryManager.cs  - Persistent image storage
│   │   ├── GalleryMenu.cs          - Gallery UI controller
│   │   ├── TouchButton.cs          - Mobile button input
│   │   └── Bootstrap.cs            - Scene initialization
│   └── Resources/
│       └── Faces/                  - 20 politician face images
├── .github/
│   └── workflows/
│       └── build-android.yml       - CI/CD automation
├── Packages/
│   └── manifest.json               - Unity dependencies
└── README.md

```

## Gameplay Instructions

1. **Start Screen**: Tap "Configure faces" to choose custom images or "Start game" to use defaults
2. **In Gallery Menu**: 
   - "Pick from gallery" - load images from your phone
   - "Clear all images" - remove custom faces
   - "Play game" - start with selected faces
3. **During Game**:
   - Tap LEFT/RIGHT buttons to move
   - Tap FIRE to shoot
   - Destroy all 4 waves to win
   - Bonus: Boss ship worth 500 points (appears every 12s)
4. **Game Over**: Tap "Play again" to restart

## Scoring

- Regular enemy: 100 + (wave × 10) + (combo × 20) points
- Boss ship: 500 points (requires 3 shots to destroy)
- Combo multiplier increases for consecutive kills within 1.25 seconds

## Technical Details

- **Engine**: Unity
- **Target**: Android (minimum API 26)
- **Orientation**: Portrait
- **Storage**: Uses `Application.persistentDataPath` for custom images
- **Audio**: 100% procedural (no audio files needed)
- **Permissions**: READ_EXTERNAL_STORAGE (for gallery access)

## Assets Included

- 20 pre-loaded faces in 128x128 PNG format
- Covers politicians from various countries (US, Spain, Russia, China, etc.)

## Customization

To add more default faces, place PNG images in `Assets/Resources/Faces/` before building.

To replace the boss face, edit `CreateLargeFaceSprite()` in GameManager.cs.

---

Built with Unity | Face Invaders © 2026
