Skip to content

MatthewKim07/you-vs-you

Repository files navigation

You vs You logo

You vs You

An adaptive AI platformer where the game learns your habits and counters them in real time.
Beat the level. Then beat your own pattern.

TypeScript Vite All Device Browsers Supabase

Run Locally Gameplay Cloud Setup


🎯 Why This Game Exists

Most platformers get easier once you discover the pattern.
You vs You flips that: the AI finds your pattern first, then challenges it.

Instead of static levels, this game uses gameplay telemetry to adapt obstacle pressure, route targeting, and trap behavior while preserving fairness and at least one viable path.


✨ Core Highlights

🧠 Adaptive AI Gameplay
Learns jump/crouch/route habits and applies behavior-based counters.
⚖️ Fair Adversarial Design
Challenges predictable play without impossible setups.
🏃 Level + Infinite Modes
Campaign progression and score-chasing survival mode.
🎒 Shop + Inventory
Unlock and manage skins, boosts, and abilities.
☁️ Cloud Sync
Supabase-backed account progress and leaderboard scoring.
🌐 Cross-Device Browser Play
Runs on phone, tablet, laptop, and desktop browsers.

🎮 Gameplay Loop

flowchart LR
    A[Play Run] --> B[AI Observes Behavior]
    B --> C[Pattern Modeling]
    C --> D[Adaptive Counter Pressure]
    D --> E[Earn Coins and Unlock Gear]
    E --> F[Adjust Strategy]
    F --> A
Loading
  1. Play runs in Level or Infinite mode
  2. AI observes route/movement habits
  3. Game adapts with targeted counters
  4. You unlock boosts, abilities, and skins
  5. You evolve strategy and push farther

🛠️ Tech Stack

  • Frontend: TypeScript, Vite, HTML5 Canvas
  • AI/Adaptation Runtime: Custom telemetry + modeling + mutation systems
  • Backend Services: Supabase Auth + Postgres tables for progress/leaderboard
  • State Persistence: Account-linked cloud persistence for cross-device continuity

🗂️ Project Structure

src/
  game.ts                # Main runtime loop, state, UI wiring
  adaptiveGenerator.ts   # Adaptive level composition + safety checks
  aiTrapDirector.ts      # Runtime trap targeting and mutation logic
  playerAnalyzer.ts      # Telemetry -> player model
  runTracker.ts          # Per-run event capture
  debugPanel.ts          # Internal diagnostics (dev use)
  renderer.ts            # Visual output

🚀 Quick Start

Step 1 Step 2 Step 3

npm install
npm run dev

Open the app at the local Vite URL.

📦 Production Build

npx tsc --noEmit
npm run build

🧠 Supabase Setup

Auth Progress Leaderboard

  1. Copy .env.example to .env
  2. Add VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY
  3. Run SQL setup files:
    • supabase-migration.sql
    • supabase-migration-2.sql
    • supabase-migration-3.sql
  4. See full details in AUTH_SETUP.md

🏁 Submission Notes (AI Game Week)

Built for a 7-day AI game challenge with gameplay-first AI adaptation.

  • ✅ Built during the hackathon window
  • ✅ Playable on all device browsers
  • ✅ Meaningful AI integrated directly into gameplay
  • ✅ Account progress, inventory persistence, and leaderboard support

📄 License

MIT (see LICENSE)

About

An adaptive browser game where the AI learns the player’s habits and changes the challenge in real time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages