# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

PONCE SIMULATOR is a Spanish-language interactive visual novel built with **Ren'Py 8.5.2**. Comedy simulator based on Jorge Ponce (Spanish comedian) with 4 independent mini-game levels. Version 1.0, targeting Windows, resolution 1920x1080.

## Running the Game

```bash
./PONCESIMULATOR.exe
# Or: python PONCESIMULATOR.py
```

No build system, test suite, or linter — runs directly through the bundled Ren'Py engine.

## Architecture

All game logic lives in **`game/script.rpy`** (~1463 lines). Other `.rpy` files:

| File | Purpose |
|------|---------|
| `game/script.rpy` | All game logic, labels, Python classes, screen definitions, asset declarations |
| `game/options.rpy` | Game metadata, version, save directory, transitions, build config |
| `game/gui.rpy` | Visual theme: colors, font sizes, resolution (1920x1080) |
| `game/screens.rpy` | RPG-style say screen (avatar + name + dialogue box), choice screen, quick menu, standard Ren'Py templates |

### Key Design Decisions

- **All default Ren'Py UI is disabled** at the top of `script.rpy` (lines 1-47): ESC, right-click, quicksave, autosave, main menu, splashscreen — all overridden to `pass`/`return`. The game controls its own flow entirely.
- **No save/load system** exposed to the player. Linear/selective experience only.
- **Custom font**: `images/upheavtt.ttf` set via both `define gui.*_font` and `init python` style overrides.
- **RPG-style dialogue box** in `screens.rpy`: avatar image on the left, name label below it, dialogue text in a dark frame on the right. Uses `avatar_map` dict to map character names to images.

### Game Flow

`start` → logo splash (2s) → `menu_principal` → `seleccion_niveles` → play any level → result video → back to `seleccion_niveles`. Credits accessible from main menu.

### The 4 Levels (in script.rpy)

1. **Nivel 2 — La Sección (Monólogo)** (`label nivel_monologo`): Multiple-choice comedy writing. 4 paragraphs × 3 options each. Scoring: +3/+2/+1 per option. Thresholds: **≥10 great, ≥7 regular, <7 bad**. Variable: `puntos_monologo`. Shows "RISAS +N" text overlays between choices.

2. **Nivel 1 — Sala de Guion** (`label nivel_sala_guion`): Click character faces to talk to 5 writers. Each "Me gusta" = +2 pts. Danny's bonus idea at departure = +3. Thresholds: **≥10/≥5/<5**. Variable: `puntos_sala`. Uses `personaje1-5_hablo` flags + `sala_personajes_screen` imagebuttons.

3. **Nivel 3 — Recoge a las Niñas** (`label nivel_hija`): 4×4 memory card game. Python class `MemoryUniquePairGame` (line 1292). 16 unique cards with randomized backs. Find the winning pair (cara1 + cara2) among 14 decoys. Time penalty: +10 min per wrong pair, starting at 16:45 with limit 17:00. Uses `renpy.jump()` from within the class to exit on win.

4. **Nivel 4 — Queda con David** (`label nivel_espera_inicio`): Real-time wait simulation. Patience bar (0-100) drains -1 every 2 seconds. Random events offer 2 activities from a pool of 8 (some restore patience, some drain it heavily). When time runs out, build a WhatsApp message in 3 blocks — each option costs patience points AND adds hostility (0-4). Thresholds: **hostility ≥10 bad, ≥6 regular, <6 good**. If patience hits 0 during wait → forced angry exit. If patience insufficient during message → forced hostile message.

### Characters (defined ~line 154)

`grox` (Jorge Ponce, #ff6b35), `p1`-`p5` (Helena, Javi, Elena, Manuel, Diego), `p6` (Danny, #2a9d8f), `n` (Narrator, white). Each has a portrait in `game/images/personajes/`.

### Assets

- **Images** (`game/images/`): 16 card faces (`cara1-16.png`), 16 card backs (`trasera1-16.png`), character portraits (`personajes/`), gift items (`regalos/`), UI elements, scene backgrounds
- **Videos** (`game/videos/`): Looping scene backgrounds (.webm), result cutscenes — 3 variants per level (good/regular/bad)
- **Root-level game images**: `whats.jpg`, `malasunto.jpg`, `podria.jpg`, `relacionsalvada.jpg` (used by nivel_espera), `images/restaurante.webm`

## Ren'Py Conventions

- Labels define game flow: `label start`, `label menu_principal`, `label nivel_*`, `label seleccion_niveles`
- `default` declares variables reset per playthrough; `define` sets constants (characters, images)
- `screen` defines UI; `call screen` pauses until screen returns; `show screen`/`hide screen` for overlays
- Python blocks: `init python:` for classes/functions, `$ var = value` for inline statements
- `Movie(play="...", loop=True/False)` for video backgrounds
- Compiled `.rpyc` files are auto-generated — **edit only `.rpy` files**
- `renpy.jump()` and `renpy.restart_interaction()` used from Python classes to control flow
