Spaces:
Sleeping
Sleeping
File size: 2,298 Bytes
c034337 6caf003 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
---
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
|