--- title: LifeFrontier emoji: 🔥 colorFrom: pink colorTo: red sdk: gradio sdk_version: 5.49.0 app_file: app.py pinned: false license: mit short_description: Couple game --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # 🏠 Life Frontier: Partner's Concerto A turn-based strategy game for couples built with Gradio. ## Quick Start ### Local Development ```bash pip install gradio python app.py ``` Open: http://localhost:7860 ## How to Play ### Setup 1. **Player 1**: Click "Create Room", get Room ID 2. **Player 2**: Enter Room ID, click "Join Room" 3. **Game starts** automatically when 2 players join 4. **Others** can join as spectators ### Gameplay - **Goal**: Achieve highest QoL score after 8 rounds - **Resources**: Time (24h/turn), HP, CP, Money, Stress - **Actions**: Rest, Execute Tasks, End Turn - **Turn-based**: Players alternate taking actions - **Elimination**: Stress ≥ 20 = game over ### Rest Actions - **Quick Nap (3h)**: Roll dice, recover 2× HP - **Full Sleep (9h)**: Recover to HP=8, CP=4, -1 stress - **Deep Rest (12h)**: Full recovery, -2 stress ### Tasks - **Work (W)**: Earn money - **Domestic (D)**: Reduce stress - **Health (H)**: Upgrade stats - **Relationship (R)**: Bond + reduce stress - **QoL (Q)**: Convert money to points ### Winning ``` Final QoL = Base QoL + Health Bonus - Stress Health Bonus = (HP max - 10) × 2 + (CP max - 5) × 3 + Reputation ``` ## Features ✅ Turn-based gameplay with SQLite state ✅ Real-time spectator mode ✅ Public rankings system ✅ Persistent game history ✅ Single Docker container ✅ No WebSocket complexity ## Game State Management All state stored in SQLite: - `rooms`: Game rooms and status - `players`: Player resources and stats - `spectators`: Viewers list - `rankings`: Leaderboard - `game_history`: Completed games ## Architecture ``` app.py (Single File) ├── Database Layer (SQLite) ├── Game Logic (Turn-based) ├── Gradio UI (3 tabs) └── Session Management ``` **No server, no WebSocket** - just simple turn-based updates! ## Tips - **Refresh** button updates game state - **Rankings** show top players by average QoL - **Spectators** can watch live but can't play - **Room IDs** are permanent until game ends