Implementar Modo DEMO (auto-play) con tecla D

CAMBIOS PRINCIPALES:
-  **Modo DEMO toggleable con tecla D** - Auto-play inteligente
-  **Sistema de acciones aleatorias** - Cada 3-8 segundos
-  **Totalmente interactivo** - Usuario puede seguir controlando
-  **Eliminado sistema auto-restart antiguo** - Ya no reinicia al pararse

CARACTERÍSTICAS DEMO MODE:
- **Acciones parametrizables** con pesos de probabilidad:
  * Cambiar gravedad (UP/DOWN/LEFT/RIGHT) - 15%
  * Activar figuras 3D (8 figuras) - 25%
  * Cambiar temas de colores (6 temas) - 20%
  * Cambiar número de pelotas (1-100K) - 15%
  * Impulsos (SPACE) - 10%
  * Toggle profundidad Z - 5%
  * Cambiar escala de figura - 5%
  * Cambiar sprite - 5%

- **Display visual**: "DEMO MODE" centrado en naranja brillante
- **Textos de feedback**: "DEMO MODE ON/OFF" al togglear

CÓDIGO ELIMINADO:
-  `checkAutoRestart()` y `performRandomRestart()` (ya no necesarios)
-  `Ball::isStopped()` y variable `stopped_` (sin uso)
-  Variables `all_balls_stopped_start_time_`, `all_balls_were_stopped_`

CONSTANTES CONFIGURABLES (defines.h):
- `DEMO_ACTION_INTERVAL_MIN/MAX` (3-8s entre acciones)
- `DEMO_WEIGHT_*` (pesos para priorizar acciones)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-04 11:28:16 +02:00
parent 2ae515592d
commit 06aabc53c0
6 changed files with 184 additions and 59 deletions

View File

@@ -20,7 +20,6 @@ class Ball {
int screen_height_; // Alto del terreno de juego
Color color_; // Color de la pelota
bool on_surface_; // Indica si la pelota est\u00e1 en la superficie (suelo/techo/pared)
bool stopped_; // Indica si la pelota ha terminado de moverse;
float loss_; // Coeficiente de rebote. Pérdida de energía en cada rebote
// Datos para modo RotoBall (esfera 3D)
@@ -71,7 +70,6 @@ class Ball {
float getLossCoefficient() const { return loss_; }
GravityDirection getGravityDirection() const { return gravity_direction_; }
bool isOnSurface() const { return on_surface_; }
bool isStopped() const { return stopped_; }
// Getters/Setters para batch rendering
SDL_FRect getPosition() const { return pos_; }