Breadcrumb

  1. Home
  2. Games By Year
  3. Games

Motion Shot

Languages

Simple English (Simple English)

Game Diversifiers
Hands Off
The World is Alive
Let's Jam!
Diverse
Platforms
Linux / Unix
Mac OS
MS Windows
Web
About
๐ŸŽฎ Motion Shot
What It Is
A hand-tracking bubble shooter game that uses your webcam to detect hand gestures. You control a slingshot by pinching your thumb and index finger, pulling back, and releasing to shoot bubbles.

Core Gameplay
๐Ÿค Pinch - Grab the slingshot ball
โœŠ Pull - Drag back to aim and charge power
๐Ÿ–๏ธ Release - Let go to fire at the bubble grid
๐ŸŽฏ Goal - Match 3+ same-colored bubbles to pop them and score points
Key Features
Feature Description
Hand Tracking Uses MediaPipe Hands via webcam for gesture detection
AI Strategy Gemini AI provides real-time targeting hints
Combo System Chain matches within 3 seconds for multiplier bonuses
Power Gauge Visual feedback showing shot strength (0-100%)
Level Progression Clear bubbles to advance through levels
Synthesized Audio Dynamic background music and sound effects
Controls
Primary: Hand gestures (pinch to grab, pull to aim, release to shoot)
Fallback: Mouse/touch for devices without camera
Tech Stack
React + TypeScript - UI framework
Canvas 2D - Game rendering
MediaPipe Hands - Hand tracking AI
Gemini AI - Strategic hints
Web Audio API - Procedural music/SFX
The Story Behind It
The game celebrates the evolution of play โ€” from ancient stone-throwing to modern gesture control. It's a "bridge between past and present," returning the power of natural hand movements to gaming.
Technology Notes
# ๐ŸŽฏ Motion Shot - Complete Game Documentation

<div align="center">

## AI-Powered Bubble Shooter with Hand Gesture Control

**"From Stones to Gestures: A Story of Play Across Time"**

---

</div>

## Table of Contents

1. [Project Overview](#1-project-overview)
2. [The Story](#2-the-story)
3. [How It's Built](#3-how-its-built)
4. [How It Works](#4-how-it-works)
5. [How to Play](#5-how-to-play)
6. [Game Features](#6-game-features)
7. [Technical Architecture](#7-technical-architecture)

---

## 1. Project Overview

### What is Motion Shot?

Motion Shot is an innovative **AI-powered bubble shooter game** that bridges ancient human play with modern technology. Using hand gestures captured through your webcam, you control a slingshot just like our ancestors threw stones โ€” but now the target is digital.

### The Philosophy

> "The hand that once shaped history is now shaping the future of gaming."

We believe technology should enhance, not replace, the natural human connection to play. Motion Shot brings back the physical joy of throwing while adding AI-powered strategy.

### Key Features

| Feature | Description |
|---------|-------------|
| ๐Ÿ–๏ธ **Hand Tracking** | MediaPipe Hands SDK tracks 21 hand landmarks for precise gesture recognition |
| ๐Ÿง  **AI Strategy (Gemini)** | Real-time tactical analysis and shot recommendations |
| ๐ŸŽจ **6-Color Scoring** | Strategic scoring with different point values per color (100-500 pts) |
| ๐Ÿ”ฅ **Combo System** | Chain matches for multiplier bonuses up to 5x |
| ๐ŸŽต **Dynamic Audio** | Synthesized background music and contextual sound effects |
| ๐Ÿ“– **Narrative Experience** | Cinematic story introduction about the evolution of play |
| โšก **Real-time Physics** | Smooth ball trajectories with wall bouncing and collision detection |

---

## 2. The Story

### From Stones to Gestures: A Story of Play Across Time

**PROLOGUE - The Dawn of Play**
Long ago, before electricity, before screens, people played using only their bodies, their minds, and nature. The hand was the main tool โ€” to throw, to aim, to defend, and to survive.

**CHAPTER I - Lessons of Fire**
Children threw stones to hit targets. Warriors trained their hands and eyes. Games were lessons of life โ€” teaching focus, patience, and skill.

**CHAPTER II - The Forgetting**
Games moved from fields to boards, then to screens. Buttons replaced hands. Controllers replaced movement. The natural connection between body and play was slowly forgotten.

**CHAPTER III - The Return**
With hand-motion control, the hand becomes the interface again. No buttons. No weapons. Just gestures โ€” pinch, pull, and release.

**EPILOGUE - Your Journey Begins**
This is not just a game. Technology did not replace humanity โ€” it returned power to it.

---

## 3. How It's Built

### Technology Stack

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ FRONTEND STACK โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ React 18+ โ”‚ UI Components & State Management โ”‚
โ”‚ TypeScript 5.x โ”‚ Type Safety & Code Quality โ”‚
โ”‚ Vite 6 โ”‚ Fast Build Tool & Dev Server โ”‚
โ”‚ Tailwind CSS โ”‚ Utility-First Styling โ”‚
โ”‚ Lucide React โ”‚ Icon Library โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ AI & VISION โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ MediaPipe Hands โ”‚ Real-time Hand Tracking (21 pts) โ”‚
โ”‚ Google Gemini AI โ”‚ Vision AI for Strategy Analysis โ”‚
โ”‚ @google/genai โ”‚ Official Gemini SDK โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ AUDIO โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Web Audio API โ”‚ Synthesized Music & Sound Effects โ”‚
โ”‚ Procedural Audio โ”‚ Dynamic Background Music โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Project Structure

```
Motion-Shot/
โ”œโ”€โ”€ App.tsx # Root component - Screen flow management
โ”œโ”€โ”€ index.tsx # Application entry point
โ”œโ”€โ”€ index.html # HTML template with MediaPipe CDN scripts
โ”œโ”€โ”€ types.ts # TypeScript type definitions
โ”œโ”€โ”€ vite.config.ts # Vite configuration
โ”œโ”€โ”€ package.json # Dependencies & scripts
โ”‚
โ”œโ”€โ”€ components/
โ”‚ โ”œโ”€โ”€ StoryPage.tsx # Cinematic story introduction
โ”‚ โ”‚ # - 5-chapter narrative
โ”‚ โ”‚ # - Particle effects
โ”‚ โ”‚ # - Animated transitions
โ”‚ โ”‚
โ”‚ โ”œโ”€โ”€ GameLauncher.tsx # Professional game menu
โ”‚ โ”‚ # - Tutorial/How to Play
โ”‚ โ”‚ # - Audio controls
โ”‚ โ”‚ # - Feature highlights
โ”‚ โ”‚
โ”‚ โ””โ”€โ”€ GeminiSlingshot.tsx # Main game component (~1500 lines)
โ”‚ # - Game loop & rendering
โ”‚ # - Physics simulation
โ”‚ # - Hand tracking integration
โ”‚ # - Combo system
โ”‚ # - UI overlays
โ”‚
โ”œโ”€โ”€ services/
โ”‚ โ”œโ”€โ”€ geminiService.ts # AI service layer
โ”‚ โ”‚ # - Gemini API integration
โ”‚ โ”‚ # - Strategic hint generation
โ”‚ โ”‚ # - Response parsing
โ”‚ โ”‚
โ”‚ โ””โ”€โ”€ soundService.ts # Audio engine
โ”‚ # - Procedural music synthesis
โ”‚ # - UI sounds
โ”‚ # - Game sound effects
โ”‚
โ””โ”€โ”€ docs/
โ”œโ”€โ”€ GAME_DOCUMENTATION.md # This file
โ”œโ”€โ”€ ARCHITECTURE.md # Technical architecture details
โ”œโ”€โ”€ API_REFERENCE.md # Type definitions & functions
โ”œโ”€โ”€ DEPLOYMENT.md # Hosting guide
โ””โ”€โ”€ CONTRIBUTING.md # Contribution guidelines
```

---

## 4. How It Works

### System Data Flow

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ WEBCAM โ”‚โ”€โ”€โ”€โ–ถโ”‚ MediaPipe โ”‚โ”€โ”€โ”€โ–ถโ”‚ Game Loop โ”‚
โ”‚ INPUT โ”‚ โ”‚ Hands SDK โ”‚ โ”‚ (60 FPS) โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ โ”‚
โ–ผ โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Hand Position โ”‚ โ”‚ Canvas Render โ”‚
โ”‚ Detection โ”‚ โ”‚ - Video BG โ”‚
โ”‚ - 21 Landmarks โ”‚ โ”‚ - Bubble Grid โ”‚
โ”‚ - Pinch Detect โ”‚ โ”‚ - Slingshot โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ - Particles โ”‚
โ”‚ โ”‚ - Ball Trail โ”‚
โ–ผ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ Slingshot โ”‚ โ”‚
โ”‚ Mechanics โ”‚โ—€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ - Power Gauge โ”‚ โ”‚
โ”‚ - Tension FX โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ - Release โ”‚ โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚
โ–ผ โ”‚ โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ–ผ โ”‚
โ”‚ Physics โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”‚ Simulation โ”‚ โ”‚ Screenshot โ”‚ โ”‚
โ”‚ - Trajectory โ”‚ โ”‚ Capture โ”‚ โ”‚
โ”‚ - Collision โ”‚ โ”‚ (480px JPEG) โ”‚ โ”‚
โ”‚ - Ball Trail โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚ โ–ผ โ”‚
โ–ผ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Gemini AI โ”‚ โ”‚
โ”‚ Match Check โ”‚ โ”‚ Vision API โ”‚ โ”‚
โ”‚ - Flood Fill โ”‚ โ”‚ - Analyze Grid โ”‚ โ”‚
โ”‚ - Combo System โ”‚ โ”‚ - JSON Responseโ”‚ โ”‚
โ”‚ - Score Update โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚
โ”‚ - Particles โ”‚ โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚
โ”‚ โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Key Mechanics

#### 1. Hand Tracking & Pinch Detection
```
MediaPipe detects 21 hand landmarks. The game uses:
- Point 4: Thumb tip
- Point 8: Index finger tip

Pinch Distance = โˆš[(thumb.x - index.x)ยฒ + (thumb.y - index.y)ยฒ]
If Pinch Distance < 0.05 โ†’ User is "grabbing" the ball
```

#### 2. Power Gauge System
```
Pull Distance determines shot power:
- 0-30%: Green (Weak shot)
- 30-60%: Yellow (Medium shot)
- 60-80%: Orange (Strong shot)
- 80-100%: Red (Maximum power)

Visual Feedback:
- Slingshot band changes color
- Tension rings pulse around ball
- Screen vibrates at high tension
- Power percentage displayed
```

#### 3. Combo System
```
Combos trigger when multiple matches occur within 3 seconds:

Combo Level โ”‚ Multiplier โ”‚ Visual Effect
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
1x โ”‚ 1.0x โ”‚ Normal
2x โ”‚ 1.5x โ”‚ "COMBO x2!" text
3x โ”‚ 2.0x โ”‚ Screen glow
4x โ”‚ 2.5x โ”‚ Enhanced particles
5x+ โ”‚ 3.0x โ”‚ Screen shake + flash
```

#### 4. Bubble Matching (Flood Fill Algorithm)
```
When ball snaps to grid:
1. Find all connected same-color bubbles
2. Use hex-grid neighbor detection (6 neighbors)
3. If cluster >= 3 bubbles:
- Deactivate bubbles
- Create explosion particles
- Calculate score: (base ร— combo ร— bubble_count)
- Show floating score animation
```

### Scoring System

| Color | Points per Bubble | Strategic Value |
|-------|------------------|-----------------|
| ๐Ÿ”ด Red | 100 | Low - Common, easy targets |
| ๐Ÿ”ต Blue | 150 | Low-Medium |
| ๐ŸŸข Green | 200 | Medium |
| ๐ŸŸก Yellow | 250 | Medium-High |
| ๐ŸŸฃ Purple | 300 | High - Valuable targets |
| ๐ŸŸ  Orange | 500 | Highest - Rare, priority target |

**Combo Multipliers**: 1x โ†’ 1.5x โ†’ 2x โ†’ 2.5x โ†’ 3x (max)

---

## 5. How to Play

### Setup Requirements

- **Desktop computer** with webcam
- **Modern browser** (Chrome, Firefox, Edge)
- **Well-lit environment** for hand tracking
- **Node.js 18+** for development

### Installation

```bash
# 1. Clone and install
git clone https://github.com/Sengwamana/Motion-Shot.git
cd Motion-Shot
npm install

# 2. Configure API Key (for AI features)
# Create .env file with:
GEMINI_API_KEY=your_gemini_api_key_here

# 3. Start the game
npm run dev

# 4. Open http://localhost:3000
```

### Game Controls

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ GAME CONTROLS โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ”‚
โ”‚ 1. SHOW YOUR HAND ๐Ÿ–๏ธ โ”‚
โ”‚ Position your hand in view of the webcam โ”‚
โ”‚ โ”‚
โ”‚ 2. PINCH TO GRAB ๐Ÿค โ”‚
โ”‚ Touch thumb to index finger near the slingshot ball โ”‚
โ”‚ โ”‚
โ”‚ 3. PULL BACK TO AIM ๐ŸŽฏ โ”‚
โ”‚ While pinching, move hand backward to stretch slingshot โ”‚
โ”‚ - Watch the power gauge (0-100%) โ”‚
โ”‚ - Band color indicates power level โ”‚
โ”‚ - Tension rings show charge intensity โ”‚
โ”‚ โ”‚
โ”‚ 4. RELEASE TO FIRE ๐Ÿš€ โ”‚
โ”‚ Open your fingers to launch the ball โ”‚
โ”‚ - Ball leaves glowing trail while flying โ”‚
โ”‚ โ”‚
โ”‚ 5. MATCH BUBBLES ๐Ÿ’ฅ โ”‚
โ”‚ Hit 3+ same-colored bubbles to pop them โ”‚
โ”‚ - Chain matches quickly for combo multipliers โ”‚
โ”‚ โ”‚
โ”‚ 6. FOLLOW AI HINTS ๐Ÿง  โ”‚
โ”‚ Watch for Gemini's strategic recommendations โ”‚
โ”‚ - Laser sight shows suggested target โ”‚
โ”‚ โ”‚
โ”‚ ALTERNATIVE: Mouse/Touch controls available as fallback โ”‚
โ”‚ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Game Flow

```
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ STORY โ”‚โ”€โ”€โ”€โ–ถโ”‚ LAUNCHER โ”‚โ”€โ”€โ”€โ–ถโ”‚ GAME โ”‚
โ”‚ PAGE โ”‚ โ”‚ MENU โ”‚ โ”‚ PLAY โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”‚ โ”‚ โ”‚
โ”‚ 5 Chapters โ”‚ How to Play โ”‚ Levels
โ”‚ Skip option โ”‚ Audio toggle โ”‚ Score
โ”‚ Navigation โ”‚ Start button โ”‚ Combos
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

---

## 6. Game Features

### Visual Effects

| Effect | Description |
|--------|-------------|
| **Ball Trail** | Glowing trail follows the ball during flight |
| **Tension Rings** | Pulsing circles around ball when pulling back |
| **Power Glow** | Ball glows brighter at higher power |
| **Floating Scores** | Animated score popups with combo multipliers |
| **Screen Shake** | Camera shake on big combos |
| **Particle Explosions** | Colorful particles when bubbles pop |
| **Release Flash** | Screen flash effect when firing |

### Audio System

| Sound Type | Trigger |
|------------|---------|
| **Background Music** | Procedural synthesized ambient music |
| **UI Click** | Button interactions |
| **Ball Launch** | Releasing the slingshot |
| **Bubble Pop** | Matching bubbles |
| **Combo Sound** | Achieving combo multipliers |
| **Game Start** | Starting the game |
| **Level Complete** | Clearing a level |

### AI Integration (Gemini)

The game integrates Google's Gemini AI for strategic assistance:

- **Board Analysis**: AI analyzes the current bubble configuration
- **Target Recommendation**: Suggests optimal bubble clusters to target
- **Color Selection**: Recommends which color ball to use
- **Strategic Rationale**: Explains why a particular move is beneficial
- **Laser Sight**: Visual indicator pointing to AI's recommended target

---

## 7. Technical Architecture

### State Management

| State Type | Usage | Purpose |
|------------|-------|---------|
| `useState` | UI elements | Score, hints, game state, level |
| `useRef` | Game physics | Ball position, velocity, bubbles (60fps) |

### Audio Engine

The sound service uses Web Audio API for procedural audio:

- **Oscillator-based synthesis** for all sounds
- **Chord progressions** for ambient music
- **Envelope generators** for dynamic volume
- **No audio files** - everything is synthesized in real-time

### Performance Optimizations

- **RequestAnimationFrame** for smooth 60fps rendering
- **Canvas layering** to minimize redraw
- **Substep collision detection** for fast-moving balls
- **Debounced AI calls** to prevent API spam
- **Image compression** for AI screenshots (480px JPEG 60%)

---

## Credits

**Motion Shot** - A game about the timeless connection between human hands and play.

- **Hand Tracking**: MediaPipe by Google
- **AI Strategy**: Google Gemini
- **Audio**: Web Audio API
- **Framework**: React + TypeScript + Vite

---

<div align="center">

*"The hand that once shaped history is now shaping the future of gaming."*

๐ŸŽฏ **Motion Shot** ๐ŸŽฏ

</div>
Installation Instructions
Quick Start
Prerequisites: Node.js 18+, Webcam, Desktop Browser

# Install dependencies
npm install

# Configure API key
cp .env.local.example .env.local
# Edit .env.local and add your GEMINI_API_KEY from https://aistudio.google.com/app/apikey

# Start the game
npm run dev
Open http://localhost:3000 in your browser and allow camera access.

๐ŸŽฎ How to Play
Show your hand to the webcam
Pinch near the slingshot ball
Pull back to aim and build power
Release to shoot!
Match 3+ bubbles of the same color to pop them. Watch the AI panel for strategic recommendations!