463 Commits

Author SHA1 Message Date
e36fa95762 afegits estats a la clase Game 2025-11-21 18:35:41 +01:00
88ce6cd570 clang-format 2025-11-21 18:02:53 +01:00
d011a41d5a mini-merdes 2025-11-21 17:35:33 +01:00
039eb20c06 millorat el log del principi antes de que jaildoc remugue 2025-11-21 14:03:11 +01:00
959a513651 modificat cmake per a definir RELEASE_BUILD en el BUILD_TYPE=release 2025-11-21 13:49:53 +01:00
1fed8f63bd eliminat el checkFiles inicial que a jaildoc li molestava 2025-11-21 13:34:20 +01:00
b475c4d818 jo arreglant lo de claude 2025-11-21 12:43:49 +01:00
972d23f178 claude arreglant el ending 2025-11-21 10:48:15 +01:00
83d4d0b954 afegit versió a la pantalla de carrega de recursos 2025-11-21 10:06:43 +01:00
ea43880d59 unificat el numero de versió 2025-11-21 09:44:48 +01:00
6bf26f7470 posat orden en defaults i defines 2025-11-21 09:30:33 +01:00
0fb986d7c4 linter 2025-11-21 08:07:32 +01:00
9aa86cd531 linter 2025-11-20 09:19:43 +01:00
34840a64cf linter 2025-11-20 09:19:24 +01:00
7d962ae752 fix: al canviar de pantalla lateralment, es resetejava la altura de salt i el jugador caia 2025-11-19 22:52:31 +01:00
28f11a42b7 corregides les conveyor belt d'algunes habitacions, de none a right 2025-11-19 22:33:01 +01:00
5337e3b4e5 linter 2025-11-19 20:43:20 +01:00
35ef99cf7c linter 2025-11-19 20:21:45 +01:00
cbe71b5af4 classe Player refactoritzada per chanclot 2025-11-19 19:56:35 +01:00
e73f573e9a arreglos en options.hpp/cpp 2025-11-19 19:06:06 +01:00
fa9723dafc fitxers room amb tile buit = -1 2025-11-19 13:31:24 +01:00
ceb2b71331 fitxers room convertits 2025-11-19 08:09:19 +01:00
0a5594b9a8 format de fitxers room 2025-11-19 07:59:33 +01:00
932de53609 creada resource_types 2025-11-18 13:52:41 +01:00
b7db34cdf7 arreglos d'estil en source/core/resources 2025-11-18 12:41:30 +01:00
4477cc4bbc eliminada tota la funcionalitat de gamepad_config_manager i la dependencia de json 2025-11-18 09:44:42 +01:00
435358ef1e arreglos estetics en credits 2025-11-18 09:22:07 +01:00
fff77e47cf corregides les tecles en la escena de credits 2025-11-18 09:14:50 +01:00
3550f26c45 actualitzat readme amb els controls 2025-11-18 09:11:31 +01:00
c0905adc62 migrada la configuracio de txt a yaml 2025-11-18 09:01:42 +01:00
f9b8edc23c migrat assets.txt a assets.yaml 2025-11-18 08:23:49 +01:00
6a18d880f2 eliminats comentaris i info de debug 2025-11-17 14:03:57 +01:00
d185a5e72a acabada la migracio de .ani a .yaml 2025-11-17 13:49:42 +01:00
0c9becae4c migrant .ani a .yaml 2025-11-17 13:31:20 +01:00
6a6cc22b21 migrant .ani a .yaml 2025-11-17 13:08:38 +01:00
3c4092df5e eliminades referencies a .ani 2025-11-17 12:55:27 +01:00
10911990dd migrant .ani a .yaml 2025-11-17 12:47:07 +01:00
21a495e40a migrat jail_audio a un .hpp (segur que ja no funciona res) 2025-11-17 12:27:58 +01:00
6827512025 migrat de yaml-cpp a fkYAML 2025-11-17 09:25:50 +01:00
23fe4a35a9 migrats els fitxers .room i .tmx a .yaml unificats 2025-11-17 08:20:02 +01:00
a5d43dfb1f nou icono
corregit Makefile
2025-11-16 21:11:52 +01:00
e4a61a7241 eliminada la clase Debug en Release 2025-11-16 20:44:15 +01:00
24a71395da afegits estils per a les notificacions (per a distinguir les de sistema de les dels logros) 2025-11-16 20:19:30 +01:00
e4c10b6b75 ACABADA LA LOGICA DE PLAYER! es pot refactoritzar i falta els casos on Player puga avançar mes de un pixel en un frame 2025-11-15 22:45:18 +01:00
710e7cc8c1 merdetes pa debugar a gust 2025-11-14 17:58:32 +01:00
8893e8f05b casi acabat el Player pero -> canvi de PC 2025-11-14 14:11:27 +01:00
7f51f02d96 treballant en Player: abans d'entrar a moveOnSlope() 2025-11-14 12:54:59 +01:00
29e0daffb0 treballant en Player 2025-11-14 10:42:30 +01:00
b8dd6e80d9 refactor(player): Simplificar structs y agregar inicialización en clase
- Eliminar constructores parametrizados redundantes de SpawnData y Data structs
- Agregar inicialización en declaración para collider_box_, jumping_sound_, falling_sound_
- Renombrar parámetro de transitionToState() para consistencia (value → state)
- Actualizar game.cpp para usar aggregate initialization de Player::Data
- Refactorizar sistema de estados del jugador con métodos por estado

Archivos modificados:
- source/game/entities/player.hpp: Simplificación de structs e inicialización
- source/game/entities/player.cpp: Refactoring del sistema de estados
- source/game/scenes/game.cpp: Actualización de construcción del Player

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 13:36:33 +01:00
46eeda4ae9 Merge branch 'refactor/room-modularization'
Refactorización completa de la clase Room siguiendo patrón Facade.

## Resumen de la refactorización

La clase Room era un God Object con más de 1500 líneas y múltiples
responsabilidades. Se ha refactorizado en 6 fases, extrayendo
responsabilidades a clases especializadas:

### Fases completadas:

1. **Fase 1**: Gestión de entidades
   - Creado EnemyManager
   - Creado ItemManager
   - Reducción: ~200 líneas

2. **Fase 2**: Sistema de colisiones
   - Creado CollisionMap
   - Extracción de geometría de colisión
   - Reducción: ~400 líneas

3. **Fase 3**: Renderizado de tilemap
   - Creado TilemapRenderer
   - Separación de lógica de rendering
   - Reducción: ~300 líneas

4. **Fase 4**: Sistema de parseo de archivos
   - Creado RoomLoader
   - Extracción de carga de .room y .tmx
   - Reducción: ~285 líneas

5. **Fase 5**: Limpieza final
   - Optimización de imports (16 → 12)
   - Correcciones de estilo
   - Reducción final

6. **Fase 6**: Corrección de estándares
   - Corregidos 9 includes relativos a absolutos
   - Cumplimiento de estándares del proyecto

## Resultados

- **Antes**: Room ~1500+ líneas (God Object)
- **Después**: Room ~260 líneas (Facade/Coordinator)
- **Reducción**: 83% del código
- **Nuevas clases**: 4 (EnemyManager, ItemManager, CollisionMap,
  TilemapRenderer, RoomLoader)
- **Compilación**: ✓ Sin errores
- **Funcionamiento**: ✓ 325 assets verificados
- **Linters**: ✓ cppcheck limpio

## Patrón aplicado

Room ahora actúa como **Facade/Coordinator** que delega a managers
especializados, manteniendo su rol legítimo como contenedor de nivel.

Closes #refactor-room
2025-11-13 12:32:53 +01:00
e13a8e5930 fix(gameplay): Corregir includes relativos a absolutos
## Problema
Durante la refactorización de Room (Fases 1-3), se introdujeron includes
relativos con ".." en 4 archivos, violando el estándar del proyecto que
requiere includes absolutos desde la raíz source/.

## Cambios Realizados

### collision_map.hpp (1 corrección)
- "../../utils/utils.hpp" → "utils/utils.hpp"

### collision_map.cpp (2 correcciones)
- "../../core/system/debug.hpp" → "core/system/debug.hpp"
- "../../utils/defines.hpp" → "utils/defines.hpp"

### enemy_manager.cpp (2 correcciones)
- "../../utils/utils.hpp" → "utils/utils.hpp"
- "../entities/enemy.hpp" → "game/entities/enemy.hpp"

### item_manager.cpp (4 correcciones)
- "../../core/audio/audio.hpp" → "core/audio/audio.hpp"
- "../../utils/utils.hpp" → "utils/utils.hpp"
- "../entities/item.hpp" → "game/entities/item.hpp"
- "../options.hpp" → "game/options.hpp"

## Validación
✓ Compilación exitosa
✓ 325 assets cargados correctamente
✓ Room files verificados
✓ Funcionamiento del juego confirmado

## Total
9 includes corregidos en 4 archivos, cumpliendo con el estándar de
includes absolutos del proyecto definido en CLAUDE.md.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 12:13:52 +01:00
c59812e4af refactor(room): Fase 5 - Final cleanup and optimization
## Summary
Final cleanup phase of Room class refactoring. Optimized dependencies,
fixed code quality issues, and improved maintainability.

## Changes Made

### Import Optimization
Reduced includes from 16 to 12 by removing unused dependencies:
- Removed STL: <algorithm>, <exception>, <fstream>, <iostream>, <sstream>
- Removed project headers: audio.hpp, debug.hpp, surface_sprite.hpp,
  resource_helper.hpp, options.hpp
- Retained only essential includes for Room's coordinator role

### Code Quality Fixes
- Fixed double std::move in constructor: data_(std::move(std::move(data)))
  → data_(std::move(data))
- Simplified getRoom() switch statement (removed redundant breaks)
- Improved code clarity and adherence to C++ best practices

### Style Consistency
- Standardized comment style in collision_map.hpp (=== → ---)

## Testing
✓ Compilation successful
✓ Game execution verified (asset loading, room parsing working)
✓ Linters run:
  - clang-tidy: 3 style warnings (false positives on const naming)
  - cppcheck: Clean (no warnings)

## Metrics
- room.cpp: 259 lines (down from 277 after Phase 4)
- Dependencies minimized to essential coordinator responsibilities
- Zero functional issues introduced

## Related
Part of Room class refactoring (God Object → Coordinator pattern)
- Phase 1: Entity management (EnemyManager, ItemManager)
- Phase 2: Collision system (CollisionMap)
- Phase 3: Tilemap rendering (TilemapRenderer)
- Phase 4: File parsing (RoomLoader)
- Phase 5: Final cleanup (this commit)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 12:05:36 +01:00
e97c951d0d Fase 4: Refactorización de Room - Extracción del sistema de parseo de archivos
## Cambios principales

### Nuevo componente: RoomLoader
- **room_loader.hpp/cpp**: Nueva clase estática para parseo de archivos
- Responsabilidades extraídas de Room:
  - Carga de archivos .room (loadRoomFile)
  - Carga de archivos .tmx de tilemap (loadRoomTileFile)
  - Parseo de claves y valores (parseKeyValue)
  - Asignación de valores a estructuras (setRoom, setEnemy, setItem)
  - Carga de bloques [enemy] y [item] (loadEnemyFromFile, loadItemFromFile)
  - Log de parámetros desconocidos (logUnknownParameter)

### Modificaciones en Room
- **room.hpp**:
  - Eliminados 9 métodos estáticos privados de parseo
  - Mantenidos 2 métodos públicos (loadRoomFile, loadRoomTileFile) que ahora delegan a RoomLoader
  - Añadido comentario indicando delegación a RoomLoader

- **room.cpp**:
  - Eliminadas ~285 líneas de código de parseo de archivos
  - Añadido #include "room_loader.hpp"
  - Implementaciones de loadRoomFile y loadRoomTileFile ahora son simples delegaciones:
    * `return RoomLoader::loadRoomFile(file_path, verbose);`
    * `return RoomLoader::loadRoomTileFile(file_path, verbose);`
  - Archivo reducido de 554 líneas a 277 líneas (50% de reducción)

### Build system
- **CMakeLists.txt**: Añadido room_loader.cpp a las fuentes del proyecto

## Diseño de RoomLoader

RoomLoader es una clase utility con solo métodos estáticos (no instanciable):
- Constructor/destructor eliminados
- No tiene estado (stateless)
- Todos los métodos son estáticos
- Encapsula toda la lógica de I/O y parseo de archivos de configuración

## Métricas
- **Código eliminado de Room**: ~285 líneas de lógica de parseo
- **Nuevo RoomLoader**: 300 líneas (room_loader.cpp)
- **Reducción en room.cpp**: De 554 a 277 líneas (50% de reducción)
- **Room.hpp**: Simplificado significativamente (9 declaraciones privadas eliminadas)

## Verificación
-  Compilación exitosa sin errores
-  Juego inicia y carga todos los archivos correctamente
-  clang-tidy: 1 warning de complejidad cognitiva (código heredado, no modificado)
-  cppcheck: Sin issues

## Progreso total de refactorización

Después de 4 fases, Room ha sido drásticamente simplificado:
- **Phase 1**: Gestión de entidades → EnemyManager & ItemManager
- **Phase 2**: Sistema de colisiones → CollisionMap (~465 líneas)
- **Phase 3**: Renderizado de tilemap → TilemapRenderer (~95 líneas)
- **Phase 4**: Parseo de archivos → RoomLoader (~285 líneas)

**Total eliminado de Room**: ~845+ líneas
**Reducción tamaño archivo**: De 1097 líneas originales a 277 líneas (75% de reducción)
**Nuevas clases especializadas**: 6 (EnemyManager, ItemManager, CollisionMap, TilemapRenderer, RoomLoader)

## Próximos pasos
- Fase 5: Limpieza final y optimización de Room como coordinador ligero

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 09:26:03 +01:00
5365d62abc Fase 3: Refactorización de Room - Extracción del sistema de renderizado de tilemap
## Cambios principales

### Nuevo componente: TilemapRenderer
- **tilemap_renderer.hpp/cpp**: Nueva clase que encapsula el renderizado del mapa de tiles
- Responsabilidades extraídas de Room:
  - Renderizado del tilemap estático
  - Gestión de tiles animados (conveyor belts)
  - Actualización de animaciones basadas en tiempo
  - Debug visualization de colisiones (en modo DEBUG)
  - Gestión de map_surface y time_accumulator

### Modificaciones en Room
- **room.hpp**:
  - Añadido TilemapRenderer como miembro (unique_ptr)
  - Removida estructura AnimatedTile (ahora privada en TilemapRenderer)
  - Removidos: map_surface_, animated_tiles_, time_accumulator_, CONVEYOR_FRAME_DURATION
  - Removidos 4 métodos privados de renderizado: fillMapTexture, setAnimatedTiles, updateAnimatedTiles, renderAnimatedTiles

- **room.cpp**:
  - Constructor: Inicializa TilemapRenderer con tile_map, tile_set_width, surface, bg_color, conveyor_belt_direction
  - Constructor: Llama a tilemap_renderer_->initialize(collision_map_)
  - Delegación: renderMap() llama a tilemap_renderer_->render()
  - Delegación: update() llama a tilemap_renderer_->update(delta_time)
  - Delegación: setPaused() llama a tilemap_renderer_->setPaused(value)
  - Removida inicialización de time_accumulator_
  - Eliminados ~95 líneas de código de renderizado (incluyendo debug lines)

### Mejoras en CollisionMap
- **collision_map.hpp/cpp**:
  - Marcados getTile(SDL_FPoint) y getTile(int) como const (const correctness)
  - Permite uso desde TilemapRenderer con puntero const

### Build system
- **CMakeLists.txt**: Añadido tilemap_renderer.cpp a las fuentes del proyecto

## Métricas
- **Código eliminado de Room**: ~95 líneas de lógica de renderizado de tilemap
- **Nuevo TilemapRenderer**: 208 líneas (tilemap_renderer.cpp)
- **Reducción en room.cpp**: Continúa la mejora en cohesión y separación de responsabilidades

## Verificación
-  Compilación exitosa sin errores
-  Juego inicia y renderiza correctamente
-  clang-tidy: 1 warning (naming style) corregido
-  cppcheck: 1 suggestion (const correctness) aplicado
-  Const correctness mejorada en CollisionMap

## Próximos pasos
- Fase 4: Extracción del parseo de archivos (RoomLoader)
- Fase 5: Limpieza final y reducción de Room a coordinador ligero

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 09:09:51 +01:00
c5ad8041e8 Fase 2: Refactorización de Room - Extracción del sistema de colisiones
## Cambios principales

### Nuevo componente: CollisionMap
- **collision_map.hpp/cpp**: Nueva clase que encapsula toda la lógica de detección de colisiones
- Responsabilidades extraídas de Room:
  - Determinación de tipos de tile (getTile)
  - Generación de geometría de colisión (superficies, rampas, conveyor belts)
  - Queries de colisión para Player y entidades
  - 14 métodos de detección de colisión
  - Getters para visualización debug

### Modificaciones en Room
- **room.hpp**:
  - Añadido CollisionMap como miembro (unique_ptr)
  - Removidos 7 vectores de geometría de colisión
  - Removidos 13 métodos privados de generación de geometría
  - Añadido getTile(int index) para soporte de animated tiles
  - Añadido destructor explícito (necesario para unique_ptr con forward declaration)

- **room.cpp**:
  - Constructor: Inicializa CollisionMap con tile_map, tile_set_width, conveyor_belt_direction
  - Delegación: Todos los métodos de colisión ahora llaman a collision_map_
  - Restaurados métodos de animated tiles (openTheJail, setAnimatedTiles, updateAnimatedTiles, renderAnimatedTiles)
  - Actualizado openTheJail() para usar enemy_manager_ en lugar de enemies_
  - Debug visualization actualizada para usar getters de CollisionMap

### Build system
- **CMakeLists.txt**: Añadido collision_map.cpp a las fuentes del proyecto

## Métricas
- **Código eliminado de Room**: ~465 líneas de lógica de colisión
- **Nuevo CollisionMap**: 487 líneas (collision_map.cpp)
- **Reducción neta en room.cpp**: Significativa mejora en cohesión

## Verificación
-  Compilación exitosa sin errores
-  Juego inicia y carga recursos correctamente
-  clang-tidy: Sin warnings en código de usuario
-  cppcheck: Sin issues reales (solo false positive en utils.hpp)

## Próximos pasos
- Fase 3: Extracción del sistema de renderizado de tilemap
- Fase 4: Extracción del parseo de archivos
- Fase 5: Limpieza final y reducción de Room a coordinador ligero

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 08:51:01 +01:00
2f90338214 Fase 1: Refactorización de Room - Extracción de gestión de entidades
Extraída la gestión de enemigos e items de Room a managers dedicados,
reduciendo las responsabilidades de la clase Room y mejorando la
separación de concernimientos.

Cambios principales:
- Creado EnemyManager para gestionar enemigos (creación, update, render, colisión)
- Creado ItemManager para gestionar items (creación, update, render, colisión, pickup)
- Room ahora delega toda la gestión de entidades a estos managers
- Room mantiene su interfaz pública sin cambios (retrocompatibilidad total)
- Eliminados vectores enemies_ e items_ de Room (reemplazados por managers)

Archivos nuevos:
- source/game/gameplay/enemy_manager.hpp/cpp
- source/game/gameplay/item_manager.hpp/cpp

Archivos modificados:
- source/game/gameplay/room.hpp/cpp
- CMakeLists.txt

Estado:
- Compilación exitosa
- Carga de assets verificada (325 assets OK)
- Linters ejecutados (clang-tidy y cppcheck)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-13 08:19:59 +01:00
477ab34057 reestructurat utils 2025-11-12 14:02:17 +01:00
9cf45062a3 netejant capçaleres 2025-11-12 13:47:19 +01:00
e626ec9763 corregit make resources.pack 2025-11-12 10:21:40 +01:00
cf40865d37 netejant capçaleres 2025-11-12 10:14:47 +01:00
580e52a51e netejant capçaleres 2025-11-11 13:02:25 +01:00
d6ced94316 netejant capçaleres 2025-11-11 12:35:21 +01:00
54fc6d2902 unificats els resources en un namespace 2025-11-11 10:04:57 +01:00
1821b84e73 fix: la pantalla de carrega carregava mal a 60FPS. es saltava bolcs per pintar.
style: adjustat el timing de loading_screen
2025-11-10 17:14:15 +01:00
6ea0acd3f3 Pos estava ci fent arreglos varios i m'han obligat a fer commit 2025-11-10 14:27:10 +01:00
b70b728b75 style: deixant guapetes les capçaleres de les classes 2025-11-10 13:53:29 +01:00
5dd463ad5a posss.. mes merdes que no van a cap lloc 2025-11-09 21:51:55 +01:00
1f01268dcf merdes varies 2025-11-08 13:21:59 +01:00
85d34fb907 style: afegides varies animacions amb easing per al Logo 2025-11-08 00:10:16 +01:00
e9fed353ff style: modificat el desplaçament de la llista de logros 2025-11-07 23:39:42 +01:00
b4f6b919d7 fix: coreció de rutes en resource_helper.cpp 2025-11-07 23:26:00 +01:00
667ab73fc6 implementada la logica de so (time based) en Player per a imitar la anterior frame based (amb els seus fallos) 2025-11-07 23:04:02 +01:00
7d0e0e0d18 fix: Player atravessava rampes al saltar recte si el framerate era molt alt 2025-11-07 20:01:07 +01:00
2c92fe8372 cppcheck 2025-11-07 17:58:47 +01:00
6e3cd05cd2 cppcheck 2025-11-07 17:01:29 +01:00
84b5ff05ad afegit cppcheck a tools/linter 2025-11-07 10:06:47 +01:00
cf6831206e style: elements de menu centrats verticalment en Title 2025-11-07 09:53:07 +01:00
9e3d3a7ce3 style: en Title, eliminat el submenu de controls 2025-11-07 09:35:44 +01:00
85844645ac fix: corregida la animació de Logo 2025-11-07 08:53:15 +01:00
da159f1409 correccions en fitxers .room 2025-11-06 20:54:14 +01:00
d875a2706b refinant la classe Player 2025-11-06 14:14:22 +01:00
288e01e47f treballant en la nova clase Player 2025-11-05 14:15:00 +01:00
a20ea5299d afegit player.md 2025-11-04 14:02:23 +01:00
66a580aff6 4 merdes fetes en la feina pr avorriment 2025-11-03 14:12:17 +01:00
d4030ec1bc linter 2025-11-03 09:58:19 +01:00
3f1c737247 linter 2025-11-03 09:52:54 +01:00
1409ab5bff corregida la velocitat del Logo 2025-11-02 22:50:57 +01:00
e08badbf22 afegida hotkey per activar/desactivar el vsync 2025-11-02 22:29:09 +01:00
64f0ef7349 Eliminar archivos binarios del repositorio y actualizar .gitignore
- Añadidas entradas para pack_resources y resources.pack al .gitignore
- Eliminados resources.pack y tools/pack_resources/pack_resources del repositorio
- Los archivos locales se mantienen pero ya no serán trackeados por git

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-02 22:28:10 +01:00
0d19cf18aa ja es pot redefinir el mando correctament 2025-11-02 19:07:46 +01:00
87527d01a8 ja redefinix els botons i axis, pero el axis sempre te un comportament default. corregir 2025-11-02 19:02:29 +01:00
b79f30a57b treballant en redefinir els botons i axis del joystick 2025-11-02 18:57:24 +01:00
6c766be023 el joc es pot controlar amb el primer mando que hi haja conectat 2025-11-02 18:18:12 +01:00
ee1dc70bd8 mogudes les tecles H, B i M a tecles de funció 2025-11-02 18:02:18 +01:00
eb550ab95b ja es poden redefinir les tecles
renombrat achievements a projects
2025-11-02 17:58:34 +01:00
13513384d1 treballant en redefine keys 2025-11-02 17:31:44 +01:00
f7aa6a2b8b afegit fadeout de musica en Title al passar al joc 2025-11-02 17:11:18 +01:00
ba06bccabc les tecles de control estan definides al fitxer de configuracio 2025-11-02 17:08:56 +01:00
9102c6a65e reorganitzat GlobalInputs 2025-11-02 16:42:45 +01:00
435ff5eb6a Title: codi mes ordenat. Fade quan transiciona a Credits. Esqueleto preparat per a treballar en redefine keys/joystick 2025-11-02 14:27:25 +01:00
af7420d7c7 Title: afegit fade i post_fade 2025-11-02 14:04:33 +01:00
4eac48ed78 LoadingScreen: nous efectes de so. Millores acabades 2025-11-02 11:00:09 +01:00
c5563768af LoadingScreen: la pantalla de carrega en BN ja es menja el Program 2025-11-02 10:25:25 +01:00
46f7968faf LoadingScreen: afegits picos de soroll als silencis 2025-11-02 10:08:39 +01:00
9cd1755266 LoadingScreen: implementat visualment la càrrega de headers 2025-11-02 09:48:07 +01:00
ef89a858c3 afegit make help 2025-11-02 07:58:12 +01:00
d46e2295ff style: en els update() de game/scenes 2025-11-01 22:52:56 +01:00
f91748bdf0 Merge branch 'main' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma 2025-11-01 22:28:58 +01:00
824e7417ad migrat Input a la ultima versió
cohesionats tots els metodes update de les escenes
2025-11-01 22:28:51 +01:00
e86539eba0 Actualizar README.md 2025-11-01 19:56:33 +01:00
1dd750ba0c corregida la carrega de config.txt 2025-11-01 19:10:51 +01:00
7441fa2b6b corregides les lectures de fitxers de text en windows. fallava per culpa del final de linea 2025-11-01 18:55:07 +01:00
139d56f8b5 millores en la pantalla de càrrega de recursos 2025-11-01 18:07:55 +01:00
b80e81dab3 fix: bug de lectura en windows en Room::loadRoomTileFile() 2025-11-01 17:51:05 +01:00
b21c52092a correccions en el Makefile per a windows 2025-11-01 17:37:01 +01:00
5c5151c032 correccions en makefile i version.h 2025-11-01 09:44:31 +01:00
66c7c9dfe6 vectoritzat el icono. nova versió 2025-11-01 09:44:16 +01:00
cb09198bfe treballant en la pantalla de càrrega de recursos 2025-11-01 08:52:03 +01:00
16aa4f52aa normalitzat el audio de options, audio i jail_audio a float entre 0.0 i 1.0 2025-11-01 00:01:20 +01:00
f67bdc6f4f modificat aseprite.png a aseprite.gif 2025-11-01 00:00:52 +01:00
eb7d1bb014 optimitzats els constructors per defecte en Options 2025-10-31 23:46:07 +01:00
5f802ed6ef afegiida aseprite font 2025-10-31 23:45:06 +01:00
635efdba5e corregit el macos_release 2025-10-31 23:11:17 +01:00
8c6bea897c actualitzada la carpeta release a SDL3
migrat a resources.pack
2025-10-31 22:58:37 +01:00
70bfced50d migrat Assets a la ultima versió (fitxers no hardcoded) 2025-10-31 12:52:22 +01:00
2f20ac422e eliminats metodes deprecated
migracions finals a time based
migracions de jail_audio a Audio
2025-10-31 10:32:23 +01:00
1bb3d00e7c migrat Scoreboard a time based 2025-10-31 09:30:33 +01:00
f08b2f9193 migrat Ending2 a time based 2025-10-31 08:40:46 +01:00
3680ff3935 migrat Ending a time based 2025-10-30 22:57:43 +01:00
99893a0c83 migrat Credits a time based 2025-10-30 22:44:33 +01:00
c5cfb518a2 treballant en la classe Player 2025-10-30 22:01:20 +01:00
1041aaf385 afegides regles per reescriure la clase Player 2025-10-30 13:36:20 +01:00
c207b456f5 tractant d'entendre el codi de Player i posar ordre 2025-10-29 21:18:15 +01:00
7cd596a0b9 fix: inicialitzacions 2025-10-29 17:16:19 +01:00
89a7f197a6 fix: corregides les velocitats negatives dels enemics als fitxers .room 2025-10-29 16:42:29 +01:00
fda22dd5f2 Merge pull request 'Ja pilla el gif i el tamany del .ani, en compte de del [enemy] en les rooms.' (#20) from jailers/jaildoctors_dilemma:main into main
Reviewed-on: JailDesigner/jaildoctors_dilemma#20
2025-10-29 15:08:35 +01:00
70d6cbfaf8 [DOC:29/10/2025] la surface ara se pillarà del .ANI
Tots els arxius .ani i .room retocats per a adequarse als canvis.
2025-10-29 14:22:36 +01:00
95dd6b4f70 [DOC:29/10/2025] w i h ja no fan falta, se pilla del .ANI 2025-10-29 12:22:20 +01:00
633936c6e8 style: arreglant capçaleres 2025-10-29 12:11:37 +01:00
95b82e5f62 fix: errors de renombrat de variables 2025-10-29 11:56:34 +01:00
ead3265bfc style: arreglades capçaleres 2025-10-29 10:58:37 +01:00
8bf9da5fb6 style: organitzada la capçalera de Room 2025-10-29 09:58:49 +01:00
cd836862c0 style: corregides les capçaleres de game/entities 2025-10-29 09:21:05 +01:00
acdad8295a actualitzats els fitxers .room a pixels per segons (la velocitat dels enemics) 2025-10-28 11:03:04 +01:00
f14a1075ab migrat Enemy a time based 2025-10-28 11:02:22 +01:00
31c84f9676 migrat Game, Player i Item a time based 2025-10-28 10:52:13 +01:00
9e8c5e13df migrat Notifier a time based 2025-10-28 10:10:47 +01:00
de8c714132 migrats els fitxers .ani a segons/frame 2025-10-28 09:49:57 +01:00
da65777a5b migrades les clases Sprite a time based 2025-10-28 09:48:58 +01:00
70b76edcbf migrat GameOver a time based 2025-10-27 19:22:36 +01:00
6af2d72ea8 linter 2025-10-27 19:03:34 +01:00
5f47c88770 linter 2025-10-27 18:56:24 +01:00
3179a08dac linter 2025-10-27 18:35:53 +01:00
b1dca32a5b linter 2025-10-27 17:39:23 +01:00
aacb14149f eliminades les opcions de configuracio de posicio de les notificacions 2025-10-27 13:24:43 +01:00
cdb9bde6aa linter 2025-10-27 13:01:11 +01:00
5d8811026d linter 2025-10-27 11:53:12 +01:00
231dcd4b3b afegida carpeta tools/linter 2025-10-27 09:22:57 +01:00
17101a3da1 optimitzada la marquesina de Title 2025-10-26 23:23:33 +01:00
87370dd11d migracio de Title a time based 2025-10-26 23:07:08 +01:00
fc17131455 mogut GlobalEvenets a core/system 2025-10-26 22:33:27 +01:00
0c87612a17 treballant en les novetats de LoadingScreen 2025-10-26 21:44:16 +01:00
96506988b6 afegida la clase Audio 2025-10-26 21:43:44 +01:00
c7b07e9351 actualitzat a la ultima versió de jail_audio 2025-10-26 21:43:29 +01:00
6d2a116d15 migracio de LoadingScreen completada 2025-10-26 19:55:25 +01:00
d1acc59319 migrant LoadingScreen a delta_time i estats 2025-10-26 19:51:08 +01:00
0388adfed8 migrat Logo a time based 2025-10-26 18:01:02 +01:00
342177a751 renombrades les clases SSprite a SurfaceSprite 2025-10-26 14:56:56 +01:00
fdea094e26 corregit el logo de jailgames 2025-10-26 14:56:24 +01:00
2eadd7d8df mes reestructuracio de fitxers de codi 2025-10-26 14:46:19 +01:00
51330db998 mogut options.section a SceneManager 2025-10-26 14:18:45 +01:00
df4965a84b canviat Options de struct a namespace 2025-10-26 14:01:08 +01:00
8f49e442de redistribuida la carpeta source 2025-10-26 13:02:45 +01:00
9676e5bc2f creada carpeta source2 2025-10-26 12:31:49 +01:00
545d471654 fix: arreglades les colisions "the static cast menner" 2025-10-16 14:14:33 +02:00
9db902c024 netejat codi mort en screen.cpp 2025-10-16 13:29:25 +02:00
7fe2523221 fix: ja funcionen els shaders 2025-10-16 12:46:02 +02:00
d5ff840445 fix: faltava fer SDL_INIT_AUDIO 2025-10-16 11:51:17 +02:00
fb5fee02e9 Ja es por jugar
Estat actual: no van els shaders. Jail_audio dona errors
2025-10-16 10:22:12 +02:00
9a4b3b04a5 Corregits mil warnings de int a float
Corregit getDisplayInfo per al calcul del zoomMax
2025-10-16 10:12:03 +02:00
e811cf0a1d apegat de mala manera els shaders del CCAE i fets uns apanyets per a vore si compila 2025-10-15 12:59:17 +02:00
e4a08d2ec7 corregides cridades a SDL3 i migrat casi tot de int a float. Falta jail_shader 2025-10-15 12:16:50 +02:00
7c102e42cc corregits mes includes
llevats els errors en texture
2025-10-15 09:14:30 +02:00
78c5333144 Redistribuits els .cpp en carpetes
Actualitzat cmake
Modificats els include de SDL2 a SDL3
2025-10-15 08:28:57 +02:00
c3415fd106 Actualizar README.md 2025-06-25 21:53:41 +02:00
428fe664bd arreglada la logica d'estats en Ending2 2025-03-21 13:24:32 +01:00
0f8de0d8b5 arreglos d'estil 2025-03-21 08:42:54 +01:00
2ee2d5c45d millorat el renderitzat amb el borde activat 2025-03-21 08:27:24 +01:00
b8cde79107 fix: en windows no es calculaven be les colisions 2025-03-20 18:45:49 +01:00
0667e2105b passat el codi de pintar el mode debug de textura a surface 2025-03-20 18:02:31 +01:00
f438e8946b style: canviar border_ a enum class 2025-03-20 14:06:58 +01:00
68c97610fb style: canvis en Game 2025-03-20 13:46:31 +01:00
7746b679b4 style: canvis en Player 2025-03-20 13:44:37 +01:00
73008992e0 fix: no actualitzava correctament la caixa de colisions del jugador al canviar d'habitació 2025-03-20 13:37:17 +01:00
d4acb38c05 Merge branch 'master' of https://gitea.sustancia.synology.me/jaildesigner/jaildoctors_dilemma 2025-03-20 08:22:39 +01:00
7aae9fb5e6 arreglos d'estil en Screen 2025-03-20 08:22:25 +01:00
a63066bd68 arreglada la paleta taronja 2025-03-19 18:07:46 +01:00
0de6117ca0 afegit comptador de frames per segon 2025-03-17 14:10:07 +01:00
a43967c279 incrementat el nivell de detall en updateLoadingProgress() 2025-03-17 13:46:38 +01:00
15ecc10d8b fix: si arrancava en pantalla completa amb shaders, no reescalava be la imatge 2025-03-16 18:55:00 +01:00
0a5996f220 afegit soport per a axis del mando 2025-03-16 17:45:07 +01:00
64ee2d1e45 actualitzat gamecontrollerdb.txt a la ultima versió 2025-03-16 17:14:01 +01:00
40dcbabfe8 afegit gif.cpp i jail_shader.cpp desde coffee_crisis_arcade_edition 2025-03-16 15:44:38 +01:00
a14f6fcf6f Mil arreglos de paletes, gifs i colors transparents
El gif del jugador de game over estava mal
2025-03-08 20:04:43 +01:00
7b3f82aa34 Establit en Cheevos el temps de les notificacions 2025-03-08 11:40:22 +01:00
3a36bf6530 Optimitzats alguns bucles en les notificacions 2025-03-08 11:38:17 +01:00
195d812d2a Les notificacions ara van per milisegons.
posibilitat d'establir el tems de una notificacio (util per a allargar les dels logros)
2025-03-08 11:29:25 +01:00
fdb85ac393 Afegida tecla per a canviar el escalat sencer 2025-03-08 10:54:44 +01:00
d4e3995d71 Millorades les paletes verda i taronja
Retocada la paleta sweetie-16
Afegida política al fitxer CMakeLists.txt
2025-03-08 10:17:22 +01:00
b885aa8c9e fix: el cursor del mouse no està amagat per defecte 2025-03-07 22:44:53 +01:00
9cf0891a04 fix: la musica del mode DEMO no era la correcta 2025-03-07 22:29:17 +01:00
09ac952404 Afegit efecte de fundit a negre per a la paleta principal i per a la secundaria. Implementat en Title 2025-03-07 14:32:35 +01:00
529bfb5e3a Eliminada paleta.cpp i mig adaptada la surface que la gastava 2025-03-07 14:12:24 +01:00
ce88596d35 No se pq el ultim commit ha deixat 4 fitxers per commitar 2025-03-07 12:21:21 +01:00
6c3e231d51 Arreglats alguns colorets que havia per ahi rebolicats
fix: Credits no estava ben portat a surfaces
2025-03-07 12:20:30 +01:00
ae5c511988 fix: tamany incorrecte per a la textura de shaders quan es desactiva el borde 2025-03-06 23:20:07 +01:00
9eaf3bc134 Retocat un poc el disseny de Title
Retocades les notificacions
2025-03-06 23:12:53 +01:00
ff309168ef Ja torna a pintar de negre la pantalla al morir 2025-03-06 22:44:44 +01:00
c5c312fc51 Ja torna a funcionar el fade del logo 2025-03-06 22:36:53 +01:00
34d34a5d91 canvi de pc 2025-03-06 22:13:13 +01:00
d339fb13b0 Canviades les paletes dels .gif
Ara es poden carregar paletes desde fitxers .pal
Reajustada la pleta general
fix: la pantalla de càrrega deixava un pixel per pintar, desde sempre
Ajustat el color del borde en el Logo i el Title per a ser igual al fondo amb les paletes de 16 colors (la del Spectrum es de 15)
2025-03-06 20:04:53 +01:00
d0e06e30c9 Ja tornen a funcionar els shaders 2025-03-06 14:24:31 +01:00
982db7f75b Ja carrega la ultima paleta seleccionada 2025-03-06 14:07:47 +01:00
68e03ac1b0 La barra de progres ja torna a estar com abans 2025-03-06 13:42:52 +01:00
537150365b Retocat el render path d'Screen 2025-03-06 13:29:39 +01:00
12e27a1062 Ja torna a funcionar el borde 2025-03-06 13:14:57 +01:00
72efa0dc46 Afegides guardes en Surface::render() per a no pintar fora del destí (no estava implementat en totes les versions de render) 2025-03-06 12:27:10 +01:00
f2bfc970bc Quan canvia de RendererSurface, torna a deixar la que havia, no la de per defecte 2025-03-06 12:09:59 +01:00
60c926a9c9 Ja funciona la roda de paletes 2025-03-06 11:45:06 +01:00
10debde847 Treballant en la caché de les paletes 2025-03-05 22:58:26 +01:00
5cc163dd14 Arreglats els endings 2025-03-05 21:57:10 +01:00
241732752a i per fi ja comença a tornar tot a la normalitat 2025-03-05 20:52:34 +01:00
5a8747cc4b val! ja pinta coses en altres surfaces 2025-03-05 19:41:55 +01:00
70a50f5117 Imposible canviar la rendererSurface 2025-03-05 18:51:36 +01:00
d41b0cb31c He posat punteros dobles i tampoc va res 2025-03-05 12:31:54 +01:00
33038e8509 canvi de pc 2025-03-05 07:44:12 +01:00
57481a1e97 Ja pinta cosetes per pantalla 2025-03-04 14:24:30 +01:00
05f91b2a94 Transició a surface acabada. Ja compila 2025-03-04 12:30:19 +01:00
c4033e3663 Transició a surface: barallantme amb tots els Color que hi ha pel codi 2025-03-03 22:58:12 +01:00
b940d627d6 Transició a surface: crec que falta room.cpp 2025-03-03 21:33:59 +01:00
b320030547 Transició a surface: ending.cpp fet 2025-03-03 20:48:31 +01:00
d7e0178602 Transició a surface: game.cpp fet 2025-03-03 19:15:24 +01:00
c9e75ad5c8 bfff, a casa a meitat enfangà.. be..
Estic acabant de convertir Title
2025-03-03 14:26:07 +01:00
8f1d1df5d6 Transició a surface: vaig per title.cpp 2025-03-02 21:56:19 +01:00
db3a0d7263 Afegides classes SSprite, SMovingSprite i SAnimatedSprite 2025-03-02 19:29:48 +01:00
636b91ae6f Afegides noves funciones a Surface 2025-03-02 18:38:17 +01:00
4b820ad6b7 Modificada la llista de fitxers 2025-03-02 18:17:37 +01:00
a4db80e116 Canviats els .png per .gif 2025-03-02 18:10:58 +01:00
2ebb285a27 fix: el brillet del cor dels credits pillava mal la posició 2025-03-02 16:51:08 +01:00
d05f18ce2d fix: amb shaders no canviava be el mode de vdeo 2025-03-02 14:56:57 +01:00
0d74a8a29f fix: s'havien fotut els dos finals, pero ja estan corregits 2025-03-02 13:43:23 +01:00
cdf0b0a694 demo.cpp a fer la mar 2025-03-02 10:41:38 +01:00
82f0992116 Llevats un parell de warnings en pLoadSurface i pLoadPal 2025-03-02 09:39:48 +01:00
b1ba5e67dc Arreglos en la estructura i format del codi 2025-03-02 09:32:25 +01:00
193dac708f canvi de pc 2025-03-02 08:09:15 +01:00
cd96be80f9 Afegit Cheevos::clearUnobtainableState(); 2025-03-01 22:49:03 +01:00
aca2be98af Arreglos en la estructura i format del codi 2025-03-01 22:36:22 +01:00
360ebfd2e6 Arreglos en la estructura i format del codi 2025-03-01 20:39:44 +01:00
5c371e7517 Arreglos en la estructura i format del codi 2025-03-01 19:33:40 +01:00
31cded15cc Arreglos en la estructura i format del codi 2025-03-01 17:01:50 +01:00
3562b139c3 Arreglos en la estructura i format del codi 2025-03-01 11:02:08 +01:00
c2040d3ded Actualitzat Makefile per al release de macos amb target x86_64-apple-macos10.15
Actualitzat el numero de versió a 1.10
2025-03-01 10:20:45 +01:00
b34f4dda42 fix: llevar el text de REDEFINE KEYS 2025-03-01 09:28:17 +01:00
4e525642a0 v1.09 2025-03-01 09:15:08 +01:00
c7db6aeaa3 canvi de pc 2025-03-01 08:11:00 +01:00
5ff04daf20 gonna fer un commit per si reventa algo: estic a meitat implementar surfaces 2025-02-28 22:58:01 +01:00
5bb2b5e7c4 fix: les notificacions ja no embruten la pantalla de càrrega 2025-02-28 14:00:59 +01:00
7a685c0cc8 fix: no pintava el efecte de carrega del borde en LoadingScreen 2025-02-28 13:40:30 +01:00
07e83fc811 Tornada a posar la musica de Title i el attract mode 2025-02-28 13:25:21 +01:00
3167251eae Eliminat el alpha de les notificacions 2025-02-28 13:13:36 +01:00
4efbb61fbc Arreglat aixina sense massa ganes Scoreboard::render() 2025-02-28 13:11:02 +01:00
3992fc08bf Afegides comprobacions de valors per al fitxer de configuració 2025-02-28 11:34:51 +01:00
366fe404ca Modes de video aclarits (sembla)
La finestra manté la posició al canviar de tamany o activar el borde
La finestra ja pot creixer mentres donde de si el escriptori
2025-02-28 09:46:55 +01:00
217781c621 lo mateix 2025-02-27 23:18:16 +01:00
212b2b481c Treballant en els modes de video 2025-02-27 21:05:01 +01:00
59e766f5c3 Nou engine de notificacions 2025-02-27 19:03:57 +01:00
2e11fec2cb canvi de pc 2025-02-27 16:51:20 +01:00
0d7ab830c9 Modificada la barra de progres de carrega de recursos per a que s'actualitze cada 5 items. Aixina ja va rapidet encara que estiga el vsync 2025-02-27 14:21:53 +01:00
0cec9f8556 Solventat bug amb el punter a ScoreboardData 2025-02-27 14:17:00 +01:00
c6474cb2da canvi de pc 2025-02-27 07:37:39 +01:00
e6fd4225a2 Ja torna a deixar jugar
Encara queden bugs per corregir
Trencat el sistema de triar la paleta, de moment
2025-02-26 20:37:29 +01:00
85ab5ea03f Singleton de ItemTracker
Arreglos menors
2025-02-26 13:07:41 +01:00
2457517f2b Afegida barra de progres en la càrrega de recursos 2025-02-26 10:05:52 +01:00
64880a427e Metodes per mostrar o amagar la finestra 2025-02-26 08:58:17 +01:00
a8e5517a77 Arreglada la cárrega de opcions i recursos
Modificats els parametros dels fitxers .ani a snake_case
2025-02-26 08:50:12 +01:00
a07a08adb7 De moment ja compila i executa, encara que no troba alguns fitxers 2025-02-25 23:03:16 +01:00
32c31a8cb6 commit de moure a un Linux a gastar eines de home 2025-02-25 19:37:08 +01:00
c9da5135b2 canvi de pc enmig de la enfangà 2025-02-25 13:18:56 +01:00
817140825a canvi de pc 2025-02-25 07:38:34 +01:00
e6f101ece6 Afegint smart pointers
Actualitzat Resources
Actualitzades les classes Sprite i derivades
Afegida nova tipografia
Actualitzat Asset
Actualitzat Text
2025-02-24 14:09:29 +01:00
48971cd5d1 canvi de pc 2025-02-24 08:52:11 +01:00
5bb5be9c33 Afinada un poc mes la classe Options 2025-02-23 20:02:55 +01:00
2ee0c70319 Reestructurant la classe Options 2025-02-23 18:12:02 +01:00
3ba4293e8a Afegit globalEvents 2025-02-23 09:53:06 +01:00
8ae686a70b globalInputs implementat en totes les seccions excepte Title i Game 2025-02-23 08:57:01 +01:00
2ac425483b Acabat amb els singletones, de moment
Arreglat els checkEvents
2025-02-22 23:39:10 +01:00
fc01676df2 Singletonejant
Borrat menu.cpp que no estava gastantse...mmm.. desde mai
2025-02-22 18:27:23 +01:00
e361d295c1 JA VA! Nomes s'havia de fer les coses be i no ser un ansias 2025-02-22 00:30:32 +01:00
f6098a479b PETA QUE NI EL PEPE KARTS 2025-02-21 22:00:33 +01:00
7a0bc5c9ae canvi de pc 2025-02-21 19:45:29 +01:00
5f68c6256f singletoning 2025-02-21 18:03:09 +01:00
debcc3409e Sanejar codi 2025-02-21 15:55:44 +01:00
c86a6496b3 Actualitzada a la ultima versió de jail_audio 2025-02-21 15:38:29 +01:00
6bb877b510 Sanejar codi 2025-02-21 14:45:41 +01:00
ec73c5fa30 Modificat CMakeLists.txt 2025-02-21 08:22:03 +01:00
4dd6c94730 Toquetechant includes 2025-02-20 13:56:07 +01:00
e1d6aff724 Toquetechant includes 2025-02-20 13:34:18 +01:00
bcb2e96069 Moguts tots els .cpp a la mateixa carpeta 2025-02-20 12:32:40 +01:00
e23f6b5ed9 Eliminat TOT el online i merdes 2025-02-20 12:07:28 +01:00
9cb57e2ff2 Implementats els shaders 2025-02-20 08:48:55 +01:00
cc0f050c50 Afegit CMakeLists.txt 2025-02-19 20:11:33 +01:00
d75a733985 Actualitzat .gitignore 2025-02-19 20:11:19 +01:00
33d91dab55 Actualitzat README.md al valencià i corregides les rutes a les imatges 2025-02-19 20:03:02 +01:00
bd6807d655 Update: createSystemFolder() ja crea la carpeta on toca en Linux 2025-02-19 19:43:56 +01:00
c6d15bb96f Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma 2025-02-19 19:36:47 +01:00
e20cc3b4bb Actualitzada la versió en info.plist 2025-02-19 19:36:33 +01:00
0baf7e5e2c Actualitzada la versió de Makefile 2025-02-19 19:36:16 +01:00
d9d4818d8a Modificado README.md 2024-08-03 09:29:51 +02:00
944784b329 Actualizado el número de versión 2024-02-22 16:58:16 +01:00
df4c1366fe Corregidos dos pequeños errores de sintaxis 2024-02-15 13:18:33 +01:00
1ee1ea560b Aumentado el tiempo que se muestra la pantalla de carga.
Posibilidad de saltar la pantalla ya cargada en el menu de titulo
2024-02-07 18:51:00 +01:00
5c7f72253c El gamestate_title ya puede empezar en diferentes estados 2024-02-07 18:34:19 +01:00
e2e41cf435 Arreglada la separación entre el titulo y el fade 2024-02-07 17:22:22 +01:00
674323d445 Commit de antes de cambiar experimentalmente muchas cosas 2024-02-07 16:52:21 +01:00
f4e2c11f1b Actualizados los ficheros gráficos del titulo 2024-02-07 16:01:16 +01:00
1b130feb85 Corregido bug en el fade de paleta. El color azul no se propagaba 2024-02-07 15:55:49 +01:00
5f3ecbbd79 Ya funciona el fade de la pantalla de carga 2024-02-07 18:48:53 +01:00
250efd69bf Ya se dibuja correctamente el gif en la pantalla 2024-02-07 17:45:22 +01:00
7cd5fec3f8 Modificado el tamaño del gif 2024-02-07 17:02:13 +01:00
8e612aaa2e Ya se dibuja el gif en pantalla 2024-02-07 16:59:25 +01:00
2d045642ff Añadidos paleta.cpp y paleta.h 2024-02-07 16:00:23 +01:00
01dff96fdc Añadido gif.c 2024-02-07 15:49:14 +01:00
62d1a566c0 Añadida nueva imagen para gestionar el fade de la pantalla de carga 2024-02-07 14:01:00 +01:00
39016a3912 Modificado el menu para que sea mas claro qué modo online está seleccionado 2024-02-07 13:46:50 +01:00
866cb56f1b Se establece el online deshabilitado por defecto al crear el fichero de configuración 2024-02-07 13:29:40 +01:00
6de3050255 Se me ha ocurrido y lo he hecho antes que nadie: poner prefijo a los .cpp i .h que definen cada uno de los estados del juego 2023-10-10 17:46:02 +02:00
f602b5ff7a FIX: No se estaba haciendo jscore::init, pero todo funcionaba correctamente 2023-10-09 23:11:25 +02:00
c34b4d8944 La sección del título se termina al pasar cierto tiempo, no cuando se termina la marquesina 2023-10-09 22:56:43 +02:00
c835f943b5 Ya gestiona correctamente los datos online para diferentes usuarios 2023-10-09 22:20:34 +02:00
9b265c6cca Intentando guardar las estadisticas y logros online. Algo hay MUY MAL y no se que es. Ya lo miraré con calma. 2023-10-09 15:28:51 +02:00
6a526df9b3 Finalizada la clase Online
Eliminado de director la parte que ejecutaba el enter_id
2023-10-09 13:47:36 +02:00
3def97bcb8 Empezada la clase Online para la gestión de los datos almacenados en el servidor 2023-10-09 13:01:39 +02:00
0a07edcb5c Modificado gitignore 2023-10-09 12:36:05 +02:00
62d90a605f Modificada la fuente subatomic
Modificado el aspecto y el comportamiento del menu de logros
2023-10-09 10:25:36 +02:00
d718e20767 Añadida fuente subatomic 2023-10-09 09:34:14 +02:00
20c63c7ef5 Añadida función para pasar cadenas a mayúsculas 2023-10-09 09:02:44 +02:00
a68ffa8e21 Los menus ya reflejan el cambio de usuario online 2023-10-09 08:49:21 +02:00
693939a6d5 Cambiado el tamaño del texto JAILDOCTOR'S en la pantalla de carga 2023-10-09 08:21:39 +02:00
031e4b99f4 Cambiada la tipografía del menu 2023-10-08 22:16:56 +02:00
1a095d292f Modificados los colores de enter_id 2023-10-08 22:14:33 +02:00
d51d564642 Mejorada la apariencia visual de la lista de logros 2023-10-08 22:13:06 +02:00
bafde2a778 Las entradas de teclado del menu de titulo ya funcionan correctamente 2023-10-08 21:13:10 +02:00
7dcc1d7809 El menu ya es funcional, com mucho margen de mejora 2023-10-08 21:07:06 +02:00
38aadb984d Ya dibuja el nuevo menu. Falta pulir un par de cosas en el dibujado 2023-10-08 16:17:47 +02:00
e259313cc9 Añadida fuente gauntlet 2023-10-08 15:16:51 +02:00
c49323cfdf Añadido efectos en el borde para imitar la carga de la pantalla como en el spectrum 2023-10-08 14:24:18 +02:00
619acbc9b4 Ya se puede dibujar en el borde. Útil para poner wallpapers o cualquier otro efectillo 2023-10-08 12:14:54 +02:00
e39806f1a3 Añadidos los graficos de la nueva pantalla de carga 2023-10-08 11:07:02 +02:00
e2618f40db Añadido versión del juego en la pantalla de titulo 2023-10-03 23:42:46 +02:00
97a6ba474f Actualizado README.md 2023-10-03 23:27:28 +02:00
07054544e4 Actualizado info.plist 2023-10-03 23:23:43 +02:00
99f6ea7dd4 Modificado MAKEFILE 2023-10-03 23:22:40 +02:00
45b75dc75f Modificado el fichero de licencia 2023-10-03 23:21:51 +02:00
a4fd00794d Ya se puede modificar el JailerID desde la pantalla de titulo, aunque hay que pulirlo un poco 2023-10-03 23:18:56 +02:00
ee261f4509 Las notificaciones simultaneas aparecen de forma escalonada 2023-10-03 21:48:24 +02:00
eb713006c6 Corregido el orden de ejecución update-checkEvents-render en todas las secciones del juego para evitar que el juego tarde en actualizarse cuando hay muchos eventos 2023-09-19 20:28:48 +02:00
a07eeff6e4 Fix: la variable showCheevos no se inicializaba correctamente 2023-09-17 17:09:43 +02:00
cce0ccba76 Añadidos std:: a title.cpp 2023-09-16 16:54:07 +02:00
0ea7eb0b9c Revert "Eliminados todos los std:: del código"
This reverts commit 4a2d27dc59.
2023-09-16 16:44:15 +02:00
4a2d27dc59 Eliminados todos los std:: del código 2023-09-16 12:44:40 +02:00
71be364141 Acabada la primera versión de la lista de logros 2023-09-16 12:29:52 +02:00
16cc725cb3 Terminado el desplazamiento por la lista de logros 2023-09-16 11:02:56 +02:00
a05dbc7581 Ya es posible desplazarse de forma prematura por la lista de logros 2023-09-15 23:02:42 +02:00
2db0b43d23 Mejoras en la presentación de la lista de logros 2023-09-15 22:33:59 +02:00
d6c100379e La pantalla de titulo ya no acaba cuando termina la marquesina si la lista de logros está activa 2023-09-15 22:00:52 +02:00
22e8579337 Ya muestra la lista de logros de forma preliminar 2023-09-15 21:31:23 +02:00
d0c0715640 Añadido: la clase cheevos devuelve una lista de los logros 2023-09-15 17:05:00 +02:00
38e0573a0e Fix: Guarda los logros también cuando se desbloquean 2023-09-15 17:00:32 +02:00
f259fbb3a5 Actualizado gitignore 2023-09-15 16:27:47 +02:00
663e1ed32e Añadida barra de información en el titulo 2023-09-15 11:44:51 +02:00
b1887fe6da Fix: No se limpiaba la pantalla tras entrar el JailerID 2023-09-15 07:45:21 +02:00
3fcf3b23e0 Actualizado .gitignore 2023-05-06 18:52:54 +02:00
284f7d5bad Cambiada la carpeta common a jail_engine 2023-05-06 18:06:29 +02:00
adab0b420c - Modificada la carpeta de guardar datos al estandar de jailgames 2023-02-12 18:05:53 +01:00
4f9d8bec42 - Cambiados los textos de los creditos/instrucciones para reflejar las nuevas teclas
- Cambiados los textos de los creditos/instrucciones para la versión de consola
2023-02-12 17:44:00 +01:00
31e657d138 - Cambiadas las teclas de cambiar el tamaño de ventana para adecuarse al estandar de jailgames 2023-02-12 17:28:48 +01:00
8b3d257baf - La ventana ya no se destruye al cambiar de tamaño de ventana
- La ventana aparece centrada al cambiar de tamaño
2023-02-12 17:05:16 +01:00
d1143b9dfe - Trabajando en la creación y destrucción de la ventana
- FIX: la clase screen no liberaba la textura gameCanvas al finalizar
2023-02-10 22:55:36 +01:00
68ebff722e - FIX: cambiado el boton de guía por el de select (o back)
- Añadido flag para intercambiar los botones de start y select en consola
- Añadido botón para activar o desactivar el borde con el mando (botón X)
2023-02-10 20:31:37 +01:00
3be9d4459c - Ya se puede usar el mando en todas las secciones del juego
- Definido flag para compilar para consola de juegos (GAME_CONSOLE)
2023-02-10 20:08:06 +01:00
76e928e21d Commit para seguir programando en WSL 2023-02-10 19:07:19 +01:00
9c6924d7bb - La clase input ya admite inputs personalizados
- El juego ya utiliza el objeto input para comprobar las teclas de cambio de tamaño de ventana, pausa, etc.
2023-02-10 18:28:53 +01:00
5007bea835 Se había quedado una linea comentada 2023-01-09 09:21:22 +01:00
5e7be1c2fb Ya se guardan los logros en un fichero 2023-01-02 09:46:09 +01:00
faf2e69b63 Creando iconos para las notificaciones 2022-12-30 13:18:43 +01:00
4c3c844ccf Fix: En la secuencia del final, al pulsar ESC se cerraba el juego. Ahora vuelve al logo 2022-12-29 15:26:02 +01:00
48b8ae049a Testeados todos los logros. Los logros no funcionan con los trucos activados 2022-12-29 14:59:48 +01:00
c0d4eddde7 Colocados los disparadores de los logros en su sitio 2022-12-29 14:08:42 +01:00
f590101047 Definidos los logros 2022-12-29 13:03:10 +01:00
c7fcbd0258 Añadidos nuevos iconos para las notificaciones. Rediseñada la notificación de login. Arreglado bug: No se podia elegir un icono para las notificaciones que no fuera de la primera fila 2022-12-29 11:58:32 +01:00
b2061c86d2 Cambiado el tamaño de las notificaciones. Posibilidad de añadir un icono 2022-12-29 11:36:44 +01:00
510a6ca718 Añadido bisel a las notificaciones 2022-12-29 11:00:26 +01:00
ec8209265a Añadidos iconos a las notificaciones 2022-12-29 10:19:11 +01:00
e963251fd9 Modificadas las notificaciones a dos lineas de texto 2022-12-29 09:42:57 +01:00
a2f1efd2a6 Empezando a trabajar con los logros 2022-12-29 09:09:36 +01:00
8959b7bcce Arreglado el cambio de paleta durante la pantalla de carga optimizada 2022-12-16 11:15:13 +01:00
4d8bb46a52 Cambiada la variable section por un puntero 2022-12-16 09:32:33 +01:00
2abde36a5e Actualizadas las etiquetas a la versión 1.07 2022-12-02 19:16:00 +01:00
0a083af712 El nombre de la habitación se pinta a partir de una textura 2022-12-02 09:35:49 +01:00
f322b1b81b Eliminada una variable static que no se utilizaba 2022-12-01 22:36:41 +01:00
13fe98edb3 Arreglado un poco el metodo de apertura de la Jail 2022-12-01 22:27:23 +01:00
c90b49c8be Añadido Batman a FEEL THE HEAT 2022-12-01 22:14:51 +01:00
d3a5c0e54f Cambiado el tamaño de la textura usado para pintar el mapa 2022-12-01 22:07:03 +01:00
254ff50ef3 Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma 2022-12-01 22:05:05 +01:00
e551206351 Actualizado el cielo de la Jail 2022-12-01 22:04:47 +01:00
b22e830dac Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma 2022-12-01 21:05:37 +01:00
a81d42cb25 Corregido bug: en la jail se rellenaban las vidas mientras estaba activa la pausa 2022-12-01 21:05:34 +01:00
3ea0025fb4 Retocada la pantalla de titulo 2022-12-01 21:03:12 +01:00
d7c49a0578 Modificado el sprite de PACO 2022-12-01 20:15:34 +01:00
4cbe55c2d4 Actualizado jail_audio a la última versión 2022-12-01 19:51:53 +01:00
564f316586 Cambiado el nombre del enemigo diskette a floppy 2022-12-01 19:32:59 +01:00
522ab8e726 Cambios cosméticos en algunas habitaciones. Cambiado el nombre de STATIC a BE CAREFUL WITH THE FUSE 2022-12-01 19:31:35 +01:00
4911282777 El color de fondo de la habitación se pinta en la textura del mapa 2022-12-01 11:40:35 +01:00
06ecabc676 Corregido un "memory leak" en texture.cpp 2022-12-01 10:43:58 +01:00
5d89a3057e Optimizado un poco el title.cpp 2022-11-30 13:43:47 +01:00
75228cc451 Eliminado el resto de accesos a vector mediante at() 2022-11-30 12:09:45 +01:00
357eec20b1 Eliminados la mayor parte de accesos a vector mediante at() 2022-11-30 12:03:37 +01:00
62c1e2715e Preparando el juego para ser compatble con consolas 2022-11-30 11:06:27 +01:00
34fc2b6b06 Optimizada la intro 2022-11-30 10:10:10 +01:00
6557dea2bb Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma 2022-11-30 08:27:11 +01:00
2caea7ba6e Optimizando la intro 2022-11-30 08:26:16 +01:00
d33d2e4a09 Cambiado el nombre de algunos enemigos 2022-11-29 21:26:28 +01:00
d9174dcdb9 Cambiado el nombre de algunos enemigos 2022-11-29 21:08:33 +01:00
22f7204e08 Añadidas mas dll para el release de windows 2022-11-29 19:41:14 +01:00
06fab0d457 Actualizado Makefile 2022-11-29 19:16:14 +01:00
f180f88068 Corregido error en el texto de las teclas nuevas para moverse 2022-11-29 19:12:04 +01:00
4109d6c938 Actualizado Readme.md. Cambiado LICENSE a LICENSE.txt 2022-11-29 19:11:02 +01:00
9c2264ca75 Actualizado Makefile 2022-11-29 19:07:59 +01:00
c59739c7ba Cambiado el tamaño del borde de porcentaje a valor absoluto en pixeles 2022-11-29 18:45:25 +01:00
4a430c0d5b Actualizadas las instrucciones con el método de control escogido 2022-11-29 18:22:40 +01:00
5a7f637f4b Cambiada la tecla de pausa a la tecla H (HOLD) 2022-11-29 18:07:31 +01:00
c63298b555 Posibilidad de escoger diferentes configuraciónes prefijadas de teclas de control desde el fichero de configuración 2022-11-29 18:05:38 +01:00
82aa91bead Corregida la funcion para verificar si existen los ficheros de recursos 2022-11-29 17:29:18 +01:00
f4129e109a Actualizado Makefile 2022-11-29 17:25:08 +01:00
5e8714697d Añadido un tile para poder bajar en la fase ULA HOP! 2022-11-29 17:23:12 +01:00
dd4355051f Merge branch 'master' of https://gitea.sustancia.synology.me/JailDesigner/jaildoctors_dilemma 2022-11-28 09:01:22 +01:00
160b212a43 Actualizado info.plist 2022-11-28 09:01:21 +01:00
69d3b076d7 Modificadas algunas fases para prevenir glitches 2022-11-28 07:53:07 +01:00
3817a01712 Guardado de las opciones de las notificaciones 2022-11-24 12:55:34 +01:00
ba19dcb904 Actualizar 'README.md' 2022-11-23 22:37:02 +01:00
b035b92ff4 Retocada ROAD TO THE JAIL 2022-11-23 22:32:57 +01:00
8c425f5698 Fix: De enter_id iba siempre a intro 2022-11-23 22:22:32 +01:00
d382bb6403 Optimizado el calculo del tamaño de las notificaciones 2022-11-23 20:53:01 +01:00
da64a5e082 Oculta el ratón en el modo a pantalla completa 2022-11-23 20:38:21 +01:00
7070dac482 Arreglado tamaño de las notificaciones en pantalla completa 2022-11-23 20:33:54 +01:00
ea5360ea74 Trabajando en las notificaciones 2022-11-23 20:14:53 +01:00
3aa4440390 Trabajando en las notificaciones 2022-11-23 20:05:07 +01:00
ce105e252e Trabajando en el tamaño de las notificaciones 2022-11-23 19:52:10 +01:00
1aac5b7719 Trabajando en las notificaciones 2022-11-23 18:20:29 +01:00
a8b467290f Completado el ciclo para pedir el ID online. Añadido sonido a las notificaciones. Agregado control de versión del fichero de configuración 2022-11-23 16:59:40 +01:00
706ad6f9c0 Trabajando en el escalado de las notificaciones 2022-11-23 14:11:47 +01:00
54d428ed96 Ya permite establecer el online ID desde el propio juego 2022-11-23 13:29:35 +01:00
c71adfbac4 Trabajando en la sección EnterID 2022-11-23 09:54:08 +01:00
1187 changed files with 429317 additions and 58878 deletions

21
.clang-format Normal file
View File

@@ -0,0 +1,21 @@
BasedOnStyle: Google
IndentWidth: 4
IndentAccessModifiers: true
ColumnLimit: 0 # Sin límite de longitud de línea
BreakBeforeBraces: Attach # Llaves en la misma línea
AllowShortIfStatementsOnASingleLine: true
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AlignOperands: DontAlign
AlignAfterOpenBracket: DontAlign
BinPackArguments: false
BinPackParameters: false
ContinuationIndentWidth: 4
ConstructorInitializerIndentWidth: 4
IndentWrappedFunctionNames: false
Cpp11BracedListStyle: true
BreakConstructorInitializers: BeforeColon
AllowAllConstructorInitializersOnNextLine: false
PackConstructorInitializers: Never
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false

85
.clang-tidy Normal file
View File

@@ -0,0 +1,85 @@
Checks:
- readability-*
- modernize-*
- performance-*
- bugprone-unchecked-optional-access
- bugprone-sizeof-expression
- bugprone-suspicious-missing-comma
- bugprone-suspicious-index
- bugprone-undefined-memory-manipulation
- bugprone-use-after-move
- bugprone-out-of-bound-access
- -readability-identifier-length
- -readability-magic-numbers
- -bugprone-narrowing-conversions
- -performance-enum-size
- -performance-inefficient-string-concatenation
- -bugprone-integer-division
- -bugprone-easily-swappable-parameters
- -modernize-avoid-c-arrays,-warnings-as-errors
WarningsAsErrors: '*'
# Solo incluir archivos de tu código fuente (external tiene su propio .clang-tidy)
# Excluye jail_audio.hpp del análisis
HeaderFilterRegex: '^source/(?!core/audio/jail_audio\.hpp).*'
FormatStyle: file
CheckOptions:
# Variables locales en snake_case
- { key: readability-identifier-naming.VariableCase, value: lower_case }
# Miembros privados en snake_case con sufijo _
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
# Miembros protegidos en snake_case con sufijo _
- { key: readability-identifier-naming.ProtectedMemberCase, value: lower_case }
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
# Miembros públicos en snake_case (sin sufijo)
- { key: readability-identifier-naming.PublicMemberCase, value: lower_case }
# Namespaces en CamelCase
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
# Variables estáticas privadas como miembros privados
- { key: readability-identifier-naming.StaticVariableCase, value: lower_case }
- { key: readability-identifier-naming.StaticVariableSuffix, value: _ }
# Constantes estáticas sin sufijo
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }
# Constantes globales en UPPER_CASE
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
# Variables constexpr globales en UPPER_CASE
- { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE }
# Constantes locales en UPPER_CASE
- { key: readability-identifier-naming.LocalConstantCase, value: UPPER_CASE }
# Constexpr miembros en UPPER_CASE (sin sufijo)
- { key: readability-identifier-naming.ConstexprMemberCase, value: UPPER_CASE }
# Constexpr miembros privados/protegidos con sufijo _
- { key: readability-identifier-naming.ConstexprMethodCase, value: UPPER_CASE }
# Clases, structs y enums en CamelCase
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
# Valores de enums en UPPER_CASE
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
# Métodos en camelBack (sin sufijos)
- { key: readability-identifier-naming.MethodCase, value: camelBack }
- { key: readability-identifier-naming.PrivateMethodCase, value: camelBack }
- { key: readability-identifier-naming.ProtectedMethodCase, value: camelBack }
- { key: readability-identifier-naming.PublicMethodCase, value: camelBack }
# Funciones en camelBack
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
# Parámetros en lower_case
- { key: readability-identifier-naming.ParameterCase, value: lower_case }

View File

@@ -0,0 +1,172 @@
---
description: Ejecuta clang-tidy en archivos C++ y analiza los resultados
---
# Lint clang-tidy Command
Ejecuta análisis estático con clang-tidy en archivos C++ específicos, analiza los resultados inteligentemente, e identifica issues reales vs falsos positivos.
## Propósito
clang-tidy detecta:
- Oportunidades de modernización C++ (auto, range-for, etc.)
- Problemas de legibilidad del código
- Potenciales bugs y memory leaks
- Optimizaciones de performance
- Violaciones de mejores prácticas
## Workflow de Ejecución
1. **Solicitar archivos al usuario** (si no se especifican)
- Pedir rutas de archivos `.cpp` o `.hpp` a analizar
- Validar que los archivos existen
2. **Verificar build directory**
- Confirmar que `build/compile_commands.json` existe
- Si no existe, informar al usuario que debe compilar primero
3. **Ejecutar clang-tidy (sin --fix)**
```bash
tools/linter/run_clang-tidy.sh archivo1.cpp archivo2.hpp
```
4. **Capturar y analizar salida**
- Parsear mensajes de error/warning
- Clasificar por categoría (modernize, readability, performance, bugprone, etc.)
- Identificar falsos positivos conocidos
5. **Presentar resumen al usuario**
- Agrupar por tipo de issue
- Separar "Críticos" vs "Recomendaciones" vs "Falsos Positivos"
- Mostrar líneas de código afectadas con contexto
6. **Ofrecer acciones**
- Preguntar si aplicar `--fix` automáticamente
- Si el usuario acepta, ejecutar con `--fix` y recompilar
## Falsos Positivos Conocidos
Ignorar o marcar como "Opcional" estos casos:
### `readability-magic-numbers` / `cppcoreguidelines-avoid-magic-numbers`
- **Contexto:** Game constants (block sizes, velocities, timers)
- **Ejemplo:** `const int BLOCK = 16;`, `player.vx = 3.0F;`
- **Acción:** Marcar como "Opcional - Game constant"
### `modernize-use-trailing-return-type`
- **Contexto:** Funciones con tipos de retorno simples
- **Ejemplo:** `int getValue() { return x_; }`
- **Acción:** Marcar como "Opcional - Style preference"
### Errores en `defaults.hpp`
- **Contexto:** Archivos de constantes del juego
- **Acción:** Ignorar completamente, mencionar al usuario que es conocido
### `readability-identifier-length`
- **Contexto:** Variables cortas comunes en loops o coordenadas (`x`, `y`, `i`, `j`)
- **Acción:** Marcar como "Opcional - Common convention"
## Categorización de Issues
### 🔴 Críticos (Requieren atención)
- `bugprone-*`: Potenciales bugs
- `cert-*`: Security issues
- Memory leaks y null pointer dereferences
- Undefined behavior
### 🟡 Recomendados (Mejoran calidad)
- `modernize-*`: C++20 modernization
- `performance-*`: Optimizaciones
- `readability-*`: Mejoras de legibilidad (excepto magic-numbers)
### ⚪ Opcionales (A criterio)
- `readability-magic-numbers` en game constants
- `modernize-use-trailing-return-type`
- `readability-identifier-length` para `x`, `y`, `i`, `j`
### ⚫ Ignorar (Falsos positivos)
- Errores en `defaults.hpp`
- Issues en carpeta `external/`
- Warnings en headers del sistema
## Formato de Reporte al Usuario
```
=== clang-tidy Analysis Results ===
📁 Archivos analizados:
- source/game/entities/player.cpp
- source/game/entities/player.hpp
🔴 Críticos (2):
player.cpp:145 [bugprone-use-after-move] - Uso de variable después de std::move()
player.cpp:230 [cert-err58-cpp] - Excepción en inicialización estática
🟡 Recomendados (5):
player.cpp:67 [modernize-use-auto] - Puede usar 'auto' en lugar de tipo explícito
player.cpp:102 [performance-unnecessary-copy-initialization] - Copia innecesaria
player.hpp:23 [readability-redundant-access-specifiers] - Especificador de acceso redundante
⚪ Opcionales (3):
player.cpp:88 [readability-magic-numbers] - Magic number '16' (Game constant: BLOCK size)
player.cpp:120 [modernize-use-trailing-return-type] - Style preference
✅ Total: 10 issues (2 críticos, 5 recomendados, 3 opcionales)
---
💡 Recomendaciones:
1. Corregir los 2 issues críticos manualmente
2. Aplicar --fix para 5 recomendaciones (revisa cambios antes de commitear)
3. Los opcionales son aceptables en código de juego
¿Deseas aplicar fixes automáticos para los issues recomendados? (y/n)
```
## Aplicar Fixes Automáticos
Si el usuario acepta:
1. **Ejecutar con --fix**
```bash
tools/linter/run_clang-tidy.sh --fix archivo1.cpp archivo2.hpp
```
2. **Informar cambios**
- Listar archivos modificados
- Recomendar revisión manual
3. **Recompilar**
```bash
cmake --build build
```
4. **Verificar compilación exitosa**
- Si falla, informar errores
- Sugerir revertir cambios si es necesario
## Notas Importantes
- **Siempre analizar sin --fix primero** para revisar cambios propuestos
- **Requiere build/compile_commands.json** - el usuario debe haber compilado antes
- **Contexto importa** - Game code tiene patrones legítimos que linters marcan como issues
- **No aplicar --fix ciegamente** - Algunos fixes pueden romper lógica del juego
- **Archivos específicos** - Siempre analizar archivos concretos, no todo el proyecto
## Integración con Otros Comandos
Este comando puede ser llamado desde:
- `/refactor-class` - Después de refactorizar una clase
- Manualmente por el usuario para análisis ad-hoc
- Antes de commits importantes
---
**Uso:**
```
/lint-clang-tidy
(El comando preguntará qué archivos analizar)
O especificar directamente:
/lint-clang-tidy source/game/entities/player.cpp
```

View File

@@ -0,0 +1,275 @@
---
description: Ejecuta cppcheck en código C++ y analiza resultados
---
# Lint cppcheck Command
Ejecuta análisis estático con cppcheck en código C++, filtra noise, e identifica issues reales relacionados con bugs, memory safety y undefined behavior.
## Propósito
cppcheck detecta:
- Memory leaks y resource leaks
- Null pointer dereferences
- Buffer overflows y array bounds issues
- Uninitialized variables
- Dead code y unused functions
- Style issues y code smells
- Undefined behavior
## Workflow de Ejecución
1. **Solicitar archivos/rutas al usuario** (si no se especifican)
- Pedir rutas de archivos `.cpp`/`.hpp` o carpetas a analizar
- Preguntar nivel de análisis (warning/all/unused)
- Default: `-w` (warning, style, performance)
2. **Validar precondiciones**
- Confirmar que los archivos/carpetas existen
- Si no existe `build/compile_commands.json`, el script lo generará automáticamente
3. **Ejecutar cppcheck**
```bash
# Para archivo específico
tools/linter/run_cppcheck.sh -w --path source/game/entities/player.cpp
# Para carpeta
tools/linter/run_cppcheck.sh -w --path source/game/entities/
# Proyecto completo (LENTO)
tools/linter/run_cppcheck.sh -w
```
4. **Leer archivo de resultados**
- `-w`: `tools/linter/cppcheck-result-warning-style-performance.txt`
- `-a`: `tools/linter/cppcheck-result-all.txt`
- `-u`: `tools/linter/cppcheck-result-unusedFunction.txt`
5. **Analizar y clasificar issues**
- Parsear formato de cppcheck: `[archivo:línea]: (severidad) mensaje`
- Filtrar falsos positivos conocidos
- Agrupar por categoría
6. **Presentar resumen al usuario**
- Mostrar issues críticos primero
- Explicar contexto cuando sea relevante
- Sugerir acciones correctivas
## Niveles de Análisis
### `-w` / `--warning` (Recomendado para uso diario)
- **Velocidad:** Rápido
- **Checks:** warning, style, performance
- **Uso:** Refactoring diario, antes de commits
- **Ejemplo:** `tools/linter/run_cppcheck.sh -w --path source/game/entities/player.cpp`
### `-a` / `--all` (Análisis exhaustivo)
- **Velocidad:** Lento
- **Checks:** Todos los checks disponibles
- **Uso:** Después de cambios mayores, auditorías de código
- **Ejemplo:** `tools/linter/run_cppcheck.sh -a --path source/game/`
### `-u` / `--unused` (Funciones no usadas)
- **Velocidad:** Medio
- **Checks:** unusedFunction
- **Uso:** Limpieza de código muerto
- **Ejemplo:** `tools/linter/run_cppcheck.sh -u`
- **Nota:** Requiere análisis de proyecto completo
## Falsos Positivos Conocidos
### `unusedFunction` en métodos públicos
- **Contexto:** Métodos de API pública, callbacks, getters/setters
- **Ejemplo:** `Player::getX()` usado desde múltiples lugares
- **Acción:** Ignorar si el método es parte de la interfaz pública
### `passedByValue` para tipos pequeños
- **Contexto:** SDL_FRect, SDL_Point, enums, small structs
- **Ejemplo:** `void setPos(SDL_FPoint pos)`
- **Acción:** Aceptable para tipos ≤ 16 bytes en game code
### `constParameter` en APIs consistentes
- **Contexto:** Parámetros que no se modifican pero mantienen consistencia de API
- **Acción:** Opcional, depende de estilo del proyecto
### `variableScope` en inicializaciones complejas
- **Contexto:** Variables declaradas antes de inicialización compleja
- **Acción:** Revisar caso por caso, puede ser falso positivo
## Categorización de Issues
### 🔴 Críticos (Requieren corrección inmediata)
- `error`: Bugs confirmados
- `memleakOnRealloc`: Memory leaks
- `nullPointer`: Null pointer dereferences
- `bufferAccessOutOfBounds`: Buffer overflows
- `uninitvar`: Variables no inicializadas
- `useAfterFree`: Use-after-free
### 🟠 Advertencias (Revisar y corregir)
- `warning`: Potenciales problemas
- `memleak`: Posibles memory leaks
- `resourceLeak`: Resource leaks (file handles, etc.)
- `doubleFree`: Double free
- `arrayIndexOutOfBounds`: Array bounds issues
### 🟡 Estilo (Mejoran calidad)
- `style`: Code smells
- `unusedVariable`: Variables no usadas
- `redundantAssignment`: Asignaciones redundantes
- `unreadVariable`: Variables escritas pero no leídas
### 🟢 Performance (Optimizaciones)
- `performance`: Optimizaciones de rendimiento
- `passedByValue`: Pasar por const& en vez de value
- `postfixOperator`: Usar prefix++ en vez de postfix++
### ⚪ Informativo (Opcional)
- `information`: Información general
- `portability`: Problemas de portabilidad
- `unusedFunction`: Funciones no usadas (revisar contexto)
## Formato de Reporte al Usuario
```
=== cppcheck Analysis Results ===
📁 Archivos analizados: source/game/entities/player.cpp
📊 Nivel: warning + style + performance
📝 Resultados: tools/linter/cppcheck-result-warning-style-performance.txt
🔴 Errores críticos (2):
player.cpp:156 [error:uninitvar] - Variable 'velocity' no inicializada
player.cpp:234 [error:nullPointer] - Posible null pointer dereference
🟠 Advertencias (3):
player.cpp:89 [warning:memleak] - Posible memory leak en 'sprite_'
player.cpp:178 [warning:arrayIndexOutOfBounds] - Índice fuera de límites
🟡 Estilo (4):
player.cpp:45 [style:unusedVariable] - Variable 'temp' declarada pero no usada
player.cpp:102 [style:redundantAssignment] - Asignación redundante a 'x_'
🟢 Performance (2):
player.cpp:67 [performance:passedByValue] - Pasar 'data' por const& (8 bytes - FALSO POSITIVO)
player.hpp:34 [performance:postfixOperator] - Usar prefix++ en lugar de postfix++
✅ Total: 11 issues
- 2 críticos ❗
- 3 advertencias
- 4 estilo
- 2 performance (1 falso positivo)
---
💡 Acción requerida:
1. ✅ Corregir 2 errores críticos INMEDIATAMENTE
2. ⚠️ Revisar 3 advertencias y corregir si aplica
3. 🔧 Considerar 4 mejoras de estilo
4. ⚡ 1 optimización real de performance (ignorar passedByValue)
📄 Detalles completos en: tools/linter/cppcheck-result-warning-style-performance.txt
```
## Acciones Post-Análisis
### Si hay errores críticos:
1. **Mostrar código afectado** con contexto
2. **Explicar el problema** en términos claros
3. **Sugerir corrección** específica
4. **Ofrecer aplicar fix** si es sencillo
### Si solo hay warnings/style:
1. **Resumir issues** por categoría
2. **Indicar prioridades** (qué corregir primero)
3. **Explicar falsos positivos** identificados
4. **Preguntar si aplicar fixes** para issues simples
### Si no hay issues:
```
✅ ¡Código limpio! No se encontraron issues.
```
## Ejemplos de Correcciones Comunes
### Uninitialized variable
```cpp
// ❌ Antes
int velocity;
if (condition) {
velocity = 10;
}
use(velocity); // Error: puede estar no inicializada
// ✅ Después
int velocity{0}; // Inicializar en declaración
if (condition) {
velocity = 10;
}
use(velocity);
```
### Memory leak
```cpp
// ❌ Antes
void loadTexture() {
texture_ = new SDL_Texture(...);
if (error) return; // Leak si hay error después
}
// ✅ Después
void loadTexture() {
auto temp = std::make_unique<SDL_Texture>(...)
if (error) return; // RAII - se libera automáticamente
texture_ = std::move(temp);
}
```
### Null pointer dereference
```cpp
// ❌ Antes
Player* player = getPlayer();
player->update(); // Puede ser nullptr
// ✅ Después
Player* player = getPlayer();
if (player != nullptr) {
player->update();
}
```
## Integración con Workflow
### Cuándo ejecutar:
1. **Después de refactoring** - Verificar que no se introdujeron bugs
2. **Antes de commit** - Análisis `-w` rápido
3. **Antes de PR** - Análisis `-a` completo
4. **Periódicamente** - Análisis `-u` para limpieza de código
### Integración con `/refactor-class`:
El comando `/refactor-class` ejecuta automáticamente:
```bash
tools/linter/run_cppcheck.sh -w --path <archivo_refactorizado>
```
## Notas Importantes
- **Genera archivos de salida** en `tools/linter/cppcheck-result-*.txt`
- **Auto-genera compile_commands.json** si no existe
- **Paralelización automática** usa N-1 cores
- **Suppressions file** excluye external/ y system headers
- **Contexto importa** - Revisar falsos positivos manualmente
- **No modifica código** - Solo reporta, no aplica fixes automáticos
---
**Uso:**
```
/lint-cppcheck
(El comando preguntará qué analizar y qué nivel usar)
O especificar directamente:
/lint-cppcheck source/game/entities/player.cpp
```

View File

@@ -0,0 +1,279 @@
---
description: Refactoriza una clase C++ aplicando buenas prácticas de estilo
---
# Refactor Class Command
Refactoriza una clase C++ siguiendo estas reglas de estilo y buenas prácticas:
## Reglas de Refactorización
### 1. Inicialización de Variables Miembro
- **Inicializar en la declaración** todas las variables "simples" que no tengan dependencias complejas:
- Tipos primitivos: `int`, `float`, `bool`, etc.
- Enumeraciones: valores de enum class
- Valores por defecto conocidos: `0`, `0.0F`, `false`, `nullptr`, etc.
- **NO inicializar en declaración** si:
- Dependen de otros miembros
- Requieren llamadas a funciones complejas
- Son punteros a recursos que necesitan construcción específica
### 2. Structs con Valores por Defecto
- **Todos los miembros de structs** deben tener valores por defecto:
- Tipos primitivos: `int x{0}`, `float y{0.0F}`, `bool flag{false}`
- Strings: `std::string name{}`
- Punteros: `Type* ptr{nullptr}`
- **Ventajas**: Inicialización segura, evita valores indefinidos
### 3. Arrays C-style → std::array
- Convertir **todos** los arrays C-style a `std::array`:
- `Type array[N]``std::array<Type, N> array{}`
- Inicializar con `{}` para zero-initialization
- Agregar `#include <array>` si no existe
- **Ventajas**: type-safety, size(), métodos STL, sin decay a pointer
### 3. Reorganización de la Clase
#### Orden de Secciones
1. **public** (primero)
2. **private** (después)
#### Dentro de cada sección (private principalmente)
1. **Estructuras y enumeraciones** (tipos anidados)
2. **Constantes** (static constexpr)
3. **Métodos** (funciones miembro)
4. **Variables miembro** (al final)
### 4. Agrupación y Comentarios de Métodos
- **En sección public**: Agrupar métodos relacionados funcionalmente
- **Comentarios en línea** (a la derecha) para describir cada método/grupo
- **Formato**: `void method(); // Descripción concisa`
- **Espaciado**: Línea en blanco entre grupos funcionales
**Ejemplo:**
```cpp
public:
static void init(...); // Inicialización singleton
static void destroy(); // Destrucción singleton
static auto get() -> T*; // Acceso al singleton
void render(); // Renderizado
void update(float dt); // Actualización lógica
auto isActive() -> bool; // Consulta estado
```
### 5. Comentarios de Variables
- **Posición**: A la derecha de la variable/grupo
- **Formato**: `// Descripción concisa`
- Agrupar variables relacionadas con un comentario común
### 6. Constructores en Structs
- **Eliminar constructores por defecto redundantes** en structs:
- Si todos los miembros tienen inicialización en declaración
- Y no hay múltiples constructores
- Eliminar `explicit Type() = default;`
- El compilador generará automáticamente un constructor por defecto
**Ejemplo:**
```cpp
struct Data {
int x{0};
std::string name{};
// NO NECESITA: explicit Data() = default;
};
```
### 7. Includes Necesarios
- Agregar includes faltantes según lo que se use
- Mantener orden alfabético si es posible
### 8. Header Guards
- **Usar `#pragma once`** en todas las cabeceras (`.hpp`)
- **NO usar** `#ifndef`/`#define`/`#endif` tradicionales
- `#pragma once` debe ser la primera línea del archivo (antes de includes)
- **Ventajas**: Más simple, menos propenso a errores, ampliamente soportado
## Ejemplo de Aplicación
### Antes:
```cpp
class Example {
private:
struct Data {
std::string name;
int value;
};
int counter_;
bool flag_;
float values_[10];
public:
Example();
void update();
};
// Constructor
Example::Example()
: counter_(0),
flag_(false) {
for (int i = 0; i < 10; ++i) {
values_[i] = 0.0F;
}
}
```
### Después:
```cpp
#pragma once
#include <array>
class Example {
public:
Example() = default; // Ya no necesita inicializar
void update();
private:
// Tipos anidados
struct Data {
std::string name{}; // Nombre con valor por defecto
int value{0}; // Valor inicializado
};
// Variables miembro
int counter_{0}; // Contador de frames
bool flag_{false}; // Estado activo
std::array<float, 10> values_{}; // Buffer de valores
};
```
## Tareas a Realizar
Cuando uses este comando en una clase específica:
1. **Leer** el archivo `.hpp` y `.cpp` correspondiente
2. **Verificar** que la cabecera use `#pragma once` (reemplazar `#ifndef`/`#define`/`#endif` si existen)
3. **Identificar** structs y agregar valores por defecto a todos sus miembros
4. **Identificar** variables que pueden inicializarse en declaración
5. **Identificar** arrays C-style que convertir a std::array
6. **Reorganizar** la estructura de la clase (public/private, agrupación)
7. **Actualizar** el archivo `.cpp` eliminando inicializaciones redundantes
8. **Compilar** para verificar sintaxis correcta
9. **Ejecutar clang-tidy** (análisis, sin --fix) y revisar resultados
10. **Ejecutar cppcheck** (nivel -w) y revisar resultados
11. **Aplicar fixes apropiados** basados en análisis de linters
12. **Recompilar** si se aplicaron fixes
13. **Reportar resumen** al usuario: cambios + hallazgos de linters
## Workflow de Linters (Pasos 9-12)
### Paso 9: Ejecutar clang-tidy
```bash
tools/linter/run_clang-tidy.sh archivo.cpp archivo.hpp
```
**Analizar resultados:**
- Identificar issues críticos (bugprone, cert)
- Separar recomendaciones válidas de falsos positivos
- Ignorar: magic-numbers en game constants, defaults.hpp errors
- Si hay issues críticos, informar al usuario y pausar
- Si solo hay recomendaciones, continuar
### Paso 10: Ejecutar cppcheck
```bash
tools/linter/run_cppcheck.sh -w --path archivo.cpp
```
**Leer archivo de resultados:**
- `tools/linter/cppcheck-result-warning-style-performance.txt`
- Identificar errores críticos (error, nullPointer, uninitvar)
- Separar warnings de style issues
- Filtrar falsos positivos (passedByValue para tipos pequeños, unusedFunction en API pública)
- Si hay errores críticos, informar al usuario y pausar
### Paso 11: Aplicar Fixes
**Si hay issues aplicables:**
1. **Fixes automáticos de clang-tidy** (solo si son seguros):
- modernize-use-auto
- readability-redundant-access-specifiers
- Performance optimizations claras
```bash
tools/linter/run_clang-tidy.sh --fix archivo.cpp archivo.hpp
```
2. **Fixes manuales necesarios:**
- Inicializar variables no inicializadas
- Corregir null pointer issues
- Resolver memory leaks
3. **Documentar cambios** para el reporte final
### Paso 12: Recompilar
Si se aplicaron fixes en paso 11:
```bash
cmake --build build
```
**Verificar:**
- ✅ Compilación exitosa → Continuar a reporte
- ❌ Errores → Informar al usuario, sugerir revisión manual
## Formato de Reporte Final (Paso 13)
```
=== Refactor Completado: ClassName ===
📝 Cambios estructurales:
✅ #pragma once aplicado
✅ 3 structs actualizados con valores por defecto
✅ 12 variables movidas a inicialización en declaración
✅ 2 arrays C-style → std::array
✅ Clase reorganizada (public primero, variables al final)
✅ Constructor simplificado (elimina 12 inicializaciones redundantes)
🔍 Análisis de linters:
clang-tidy:
✅ Sin issues críticos
🟡 3 recomendaciones aplicadas automáticamente:
- Modernize: use auto (2 lugares)
- Readability: redundant specifier (1 lugar)
⚪ 2 opcionales ignorados:
- magic-numbers en game constants
cppcheck:
✅ Sin errores
🟡 2 style issues encontrados:
- Unused variable 'temp' en línea 45 → Eliminada
- Redundant assignment en línea 102 → Corregida
📊 Resultado:
✅ Compilación exitosa
✅ Todos los linters pasan sin issues críticos
✅ Código refactorizado y verificado
💡 Próximos pasos:
- Revisar cambios manualmente
- Ejecutar tests si existen
- Commitear con mensaje descriptivo
```
## Notas Importantes
- **No cambiar lógica**: Solo refactorización estructural
- **Mantener compatibilidad**: std::array usa misma sintaxis [] para acceso
- **Formato consistente**: Respetar estilo del proyecto (comentarios, espaciado)
- **Validar compilación**: Siempre verificar que compile después de cambios
- **Linters integrados**: Análisis automático post-refactor para garantizar calidad
- **Fixes inteligentes**: Solo aplicar --fix de clang-tidy si los cambios son seguros
- **Contexto importa**: Game code tiene patrones legítimos (magic numbers, etc.)
- **Falsos positivos**: Identificar y documentar, no corregir ciegamente

View File

@@ -0,0 +1,21 @@
{
"permissions": {
"allow": [
"Bash(clang-tidy:*)",
"Bash(cat:*)",
"Bash(tools/linter/run_cppcheck.sh:*)",
"Bash(cmake --build:*)",
"Bash(tee:*)",
"Bash(tools/linter/run_clang-tidy.sh:*)",
"Bash(find:*)",
"Bash(for file in source/game/scenes/title.cpp source/game/scenes/game.cpp source/game/entities/player.cpp source/game/options.cpp source/core/rendering/screen.cpp)",
"Bash(do echo \"=== $file ===\")",
"Bash(done)",
"Bash(Xvfb:*)",
"Bash(chmod:*)",
"Bash(timeout:*)"
],
"deny": [],
"ask": []
}
}

15
.gitignore vendored
View File

@@ -1,5 +1,5 @@
.vscode
*data/config/config.txt
.vscode/
*data/config/config.yaml
*stats.txt
*.DS_Store
thumbs.db
@@ -10,4 +10,13 @@ thumbs.db
*.tar.gz
*.zip
*.app
*_debug*
*_debug*
jaildoctors_dilemma*
todo
build/
linux_utils/
source/version.h
resources.pack
jdd_release/
tools/pack_resources/pack_resources
tools/pack_resources/pack_resources.exe

990
CLAUDE.md Normal file
View File

@@ -0,0 +1,990 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
---
# JailDoctor's Dilemma - Codebase Architecture Guide
## Overview
**JailDoctor's Dilemma** is a retro-style 2D puzzle platformer game built in C++20 using SDL3 for graphics and audio. The game features 60+ rooms, collectible items, enemies, and an achievement system. It targets multiple platforms (Windows, macOS, Linux) with a focus on retro aesthetics and precise collision detection.
**Language:** C++20
**Graphics:** SDL3, OpenGL
**Audio:** SDL3 + custom jail_audio library
**Build:** CMake 3.10+
**Game Canvas:** 256x192 pixels (retro resolution)
---
## Build Commands
### Initial Setup & Build
```bash
# From project root
mkdir -p build
cd build
cmake ..
cmake --build .
```
### Rebuild After Changes
```bash
# From build directory
cmake --build .
# Or from project root
cmake --build build
```
### Clean Build
```bash
# From build directory
cmake --build . --clean-first
# Or from project root
cmake --build build --clean-first
```
### Run the Game
```bash
# Executable is placed in project root
./jaildoctors_dilemma
```
**Important:** The build directory is `/Users/sergio/Gitea/jaildoctors_dilemma/build` and the output executable is placed in the project root directory.
### Testing in Headless Environment (SSH/Remote Server)
**IMPORTANT:** When working on a remote server via SSH without a physical display, the game MUST be run using Xvfb (X Virtual Framebuffer) to avoid SDL3 display initialization errors.
#### Required Setup (One-time)
```bash
# Install Xvfb
sudo apt-get install xvfb
```
#### Running the Game in Headless Mode
**Option 1: Using the wrapper script (RECOMMENDED)**
```bash
./run_headless.sh
```
**Option 2: Using xvfb-run directly**
```bash
xvfb-run -a ./jaildoctors_dilemma
```
**Option 3: Custom display configuration**
```bash
xvfb-run -a -s "-screen 0 1280x720x24" ./jaildoctors_dilemma
```
#### Why This Is Critical
- **SDL3 requires a display:** The game uses SDL3 which requires X11/Wayland display
- **No code changes needed:** Xvfb simulates a virtual display without modifying the codebase
- **Full logging:** Console output and logs work normally, essential for debugging resource loading
- **Testing resource loading:** When modifying asset loading code, running with xvfb-run allows seeing all initialization logs
**ALWAYS use xvfb-run when testing on the remote server, especially when:**
- Modifying resource loading code
- Testing asset initialization
- Debugging startup issues
- Verifying configuration changes
### Static Analysis Tools (Linters)
This project uses two complementary static analysis tools for code quality:
#### clang-tidy (Modernization & Best Practices)
**Purpose:** Detects style issues, modernization opportunities, and potential bugs. Best for refactoring and applying C++20 best practices.
**IMPORTANT:** Always run on specific files, NOT on the entire project, to avoid long execution times and errors in unrelated files.
```bash
# Analyze a specific file (RECOMMENDED)
tools/linter/run_clang-tidy.sh source/game/entities/player.cpp
# Analyze multiple specific files
tools/linter/run_clang-tidy.sh source/game/entities/player.cpp source/game/entities/enemy.cpp
# Apply fixes automatically to a specific file
tools/linter/run_clang-tidy.sh --fix source/game/entities/player.cpp
# Analyze entire project (SLOW, may have errors in defaults.hpp)
tools/linter/run_clang-tidy.sh
```
**Common clang-tidy Checks:**
- `modernize-*`: C++ modernization (use auto, range-for, etc.)
- `readability-*`: Code readability improvements
- `performance-*`: Performance optimizations
- `bugprone-*`: Potential bug detection
**Known False Positives:**
- `defaults.hpp`: May report errors in constant definitions
- `readability-magic-numbers`: Acceptable for game constants (block sizes, speeds, etc.)
- `cppcoreguidelines-avoid-magic-numbers`: Same as above, acceptable in game code
#### cppcheck (Bug Detection & Memory Safety)
**Purpose:** Detects bugs, memory leaks, undefined behavior, and style issues. Complementary to clang-tidy.
```bash
# Warning, style, and performance analysis (RECOMMENDED for daily use)
tools/linter/run_cppcheck.sh -w --path source/game/entities/player.cpp
# Exhaustive analysis (slower, more thorough)
tools/linter/run_cppcheck.sh -a --path source/game/entities/
# Detect unused functions (whole project analysis)
tools/linter/run_cppcheck.sh -u
# Analyze entire project with warning level
tools/linter/run_cppcheck.sh -w
```
**Output:** Results are saved in `tools/linter/cppcheck-result-*.txt`
**Common cppcheck Checks:**
- Memory leaks and resource management
- Null pointer dereferences
- Buffer overflows and array bounds
- Uninitialized variables
- Dead code and unused functions
**Known False Positives:**
- `unusedFunction`: May report false positives for callback functions or public API methods
- `passedByValue`: Acceptable for small types like SDL_FRect in game code
- `constParameter`: Not always applicable for API consistency
#### When to Use Each Tool
| Scenario | Tool | Reason |
|----------|------|--------|
| **Daily refactoring** | clang-tidy | Fast, auto-fixable issues |
| **Before committing** | Both | Comprehensive quality check |
| **After major changes** | cppcheck -a | Deep bug analysis |
| **Hunting memory leaks** | cppcheck | Specialized detection |
| **Code modernization** | clang-tidy --fix | Automatic C++20 upgrades |
#### Best Practices
1. **Run linters after compilation succeeds** - Fix compile errors first
2. **Analyze specific files** - Faster feedback, avoids unrelated errors
3. **Review before applying --fix** - Understand changes before accepting
4. **Context matters** - Game code may legitimately have "magic numbers" for gameplay constants
5. **Use both tools** - They catch different issues and complement each other
6. **Check suppressions file** - `tools/linter/cppcheck_suppressions` excludes external/ and system headers
#### Integration with Development Workflow
When refactoring code (especially with `/refactor-class` command):
1. Make structural changes
2. **Compile** to verify syntax
3. **Run clang-tidy** (without --fix) to identify issues
4. **Run cppcheck -w** to catch bugs
5. Review and fix legitimate issues
6. Apply automatic fixes if appropriate
7. Recompile and test
**Note:** The `/refactor-class` command automatically runs both linters after compilation and provides intelligent analysis of results.
---
## 1. High-Level Architecture Overview
The architecture follows a **layered, modular design** with clear separation of concerns:
```
┌─────────────────────────────────────┐
│ Application Layer │
│ (Director, Scene Manager) │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ Game Logic Layer │
│ (Game Scene, Entities, Gameplay) │
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ Core Systems Layer │
│ (Rendering, Audio, Input, Resources)│
└─────────────────────────────────────┘
┌─────────────────────────────────────┐
│ SDL3 & External Libraries │
│ (jail_audio, stb_image, stb_vorbis) │
└─────────────────────────────────────┘
```
### Key Design Principles
- **Singleton Pattern:** Core systems (Director, Screen, Audio, Input, Resource, Asset) use singleton pattern for global access
- **Scene-Based Architecture:** Game flow managed through discrete scenes (Logo, Title, Loading, Game, Ending, etc.)
- **Component-Based Entities:** Player, enemies, and items are discrete entities with render/update patterns
- **Resource Management:** All assets (textures, sounds, animations, tilemaps) cached through Resource singleton
- **Delta Time:** Frame-rate independent physics using DeltaTimer class
---
## 2. Directory Structure
```
source/
├── core/ # Core engine systems
│ ├── audio/ # Audio management
│ │ └── audio.hpp/cpp # Audio singleton (music, sounds, volumes)
│ ├── input/ # Input handling
│ │ ├── input.hpp/cpp # Input manager (keyboard, gamepad)
│ │ ├── global_inputs.hpp # Global input state
│ │ └── mouse.hpp # Mouse input
│ ├── rendering/ # Graphics rendering
│ │ ├── screen.hpp/cpp # Screen/window singleton, SDL renderer
│ │ ├── surface.hpp/cpp # 8-bit indexed color surface abstraction
│ │ ├── surface_sprite.hpp # Static sprite rendering
│ │ ├── surface_animated_sprite.hpp # Animated sprite with frame data
│ │ ├── surface_moving_sprite.hpp # Moving sprite with velocity
│ │ ├── texture.hpp/cpp # SDL texture wrapper
│ │ ├── text.hpp/cpp # Text rendering system
│ │ ├── gif.hpp/cpp # GIF image loader
│ │ ├── opengl/ # OpenGL shader backend
│ │ │ └── opengl_shader.hpp/cpp # CRT shader effects
│ │ └── shader_backend.hpp # Abstract shader interface
│ ├── resources/ # Asset & Resource management
│ │ ├── asset.hpp/cpp # Asset registry (file path mapping)
│ │ └── resource.hpp/cpp # Resource singleton (loads/caches assets)
│ └── system/ # System management
│ ├── director.hpp/cpp # Main application controller
│ ├── debug.hpp/cpp # Debug info overlay
│ └── global_events.hpp/cpp # Global event broadcasting
├── game/ # Game-specific logic
│ ├── entities/ # Game objects
│ │ ├── player.hpp/cpp # Player entity with physics
│ │ ├── enemy.hpp/cpp # Enemy entities
│ │ └── item.hpp/cpp # Collectible items
│ ├── gameplay/ # Core gameplay systems
│ │ ├── room.hpp/cpp # Room/level logic, tilemap, collision
│ │ ├── room_tracker.hpp/cpp # Tracks visited rooms
│ │ ├── scoreboard.hpp/cpp # Score display & data
│ │ ├── item_tracker.hpp/cpp # Tracks collected items
│ │ ├── stats.hpp/cpp # Game statistics
│ │ └── cheevos.hpp/cpp # Achievement system
│ ├── scenes/ # Game scenes (flow states)
│ │ ├── logo.hpp/cpp # JailGames logo screen
│ │ ├── loading_screen.hpp/cpp # Resource loading progress
│ │ ├── title.hpp/cpp # Title screen & menus
│ │ ├── game.hpp/cpp # Main gameplay loop
│ │ ├── game_over.hpp/cpp # Game over screen
│ │ ├── ending.hpp/cpp # Ending sequence 1
│ │ ├── ending2.hpp/cpp # Ending sequence 2
│ │ └── credits.hpp/cpp # Credits screen
│ ├── ui/ # User interface
│ │ └── notifier.hpp/cpp # Achievement/notification display
│ ├── options.hpp/cpp # Game configuration/options
│ ├── scene_manager.hpp # Scene flow state machine
│ ├── defaults.hpp # Game defaults constants
│ └── gameplay.hpp # Gameplay constants
├── external/ # Third-party libraries
│ ├── jail_audio.hpp/cpp # Custom audio library
│ ├── jail_audio.h # C interface for jail_audio
│ ├── stb_image.h # Image loading library
│ └── stb_vorbis.h # OGG Vorbis audio decoding
├── utils/ # Utility code
│ ├── delta_timer.hpp/cpp # Frame-rate independent timing
│ ├── defines.hpp # Game constants (resolutions, block sizes)
│ └── utils.hpp/cpp # Helper functions (colors, math)
└── main.cpp # Application entry point
config/ # Configuration files
└── assets.yaml # Asset registry (text-based configuration)
data/ # Game assets
├── font/ # Bitmap fonts + descriptors
├── palette/ # Color palettes (.pal files)
├── shaders/ # GLSL vertex/fragment shaders
├── room/ # Tilemaps & room definitions (01.tmx-60.tmx)
├── tilesets/ # Tileset graphics
├── enemies/ # Enemy sprites & animations
├── player/ # Player sprites & animations
├── items/ # Item sprite sheets
├── music/ # Background music (OGG)
├── sound/ # Sound effects (WAV)
├── logo/ # Logo images
├── loading/ # Loading screen graphics
├── title/ # Title screen graphics
├── ending/ # Ending sequence images
└── credits/ # Credits screen assets
```
---
## 3. Key Architectural Patterns
### 3.1 Singleton Pattern (Core Systems)
Most core systems use thread-safe singleton pattern:
```cpp
class Screen {
private:
static Screen* screen_; // Singleton instance
Screen(); // Private constructor
~Screen();
public:
static void init(); // Creates singleton
static void destroy(); // Destroys singleton
static Screen* get(); // Accesses singleton
};
```
**Singleton Systems:**
- `Screen` - Rendering, window management, palette/shader effects
- `Input` - Keyboard & gamepad input binding and checking
- `Audio` - Music and sound effect playback
- `Resource::Cache` - Asset loading, caching, streaming (with error handling)
- `Resource::List` - Asset path registry from assets.yaml (O(1) lookups)
- `Director` - Main application controller
- `Cheevos` - Achievement state management
- `Debug` - Debug information overlay
### 3.2 Scene-Based State Machine
The game uses a scene manager to control application flow:
```cpp
// namespace SceneManager
enum class Scene {
LOGO, LOADING_SCREEN, TITLE, CREDITS, GAME, DEMO,
GAME_OVER, ENDING, ENDING2, QUIT
};
inline Scene current = Scene::LOGO; // Global scene state
inline Options options = ...; // Transition options
```
**Scene Hierarchy:**
- Each scene runs its own update/render loop
- `Director` switches between scenes based on `SceneManager::current`
- Scenes can request transitions via `SceneManager::current` assignment
### 3.3 Entity-Component Pattern (Simplified)
Entities (Player, Enemies, Items) have:
- **Update** - Logic, physics, animation
- **Render** - Draw to screen surface
- **Collision** - Hit detection (player collides with room, enemies, items)
### 3.4 Surface-Based Rendering Pipeline
The rendering system uses a **8-bit indexed color** pipeline:
```
SurfaceData (pixel buffer)
Surface (palette + rendering operations)
SDL_Texture (GPU texture)
SDL_Renderer (to SDL_Window)
Display
```
**Key Components:**
- `Surface` - 8-bit indexed pixel buffer with palette support
- `SurfaceSprite` - Renders a fixed region of a surface
- `SurfaceAnimatedSprite` - Frame-based animation on top of sprite
- `SurfaceMovingSprite` - Adds velocity/position to animated sprite
- Supports color replacement, palette swapping, and shader effects (CRT)
### 3.5 Tile-Based Collision System
Rooms use a sophisticated collision detection system:
```cpp
class Room {
std::vector<LineHorizontal> bottom_floors_; // Ground surfaces
std::vector<LineHorizontal> top_floors_; // Ceiling surfaces
std::vector<LineVertical> left_walls_; // Left walls
std::vector<LineVertical> right_walls_; // Right walls
std::vector<LineDiagonal> left_slopes_; // Ramps going left
std::vector<LineDiagonal> right_slopes_; // Ramps going right
std::vector<LineHorizontal> conveyor_belt_floors_; // Moving platforms
};
```
**Collision Detection:**
- Player has collision points and "feet" points for fine-grained detection
- Room provides `check*Surfaces()` methods for collision resolution
- Supports ramps, slopes, conveyor belts, and auto-surfaces
- Enemies have axis-aligned bounding boxes
### 3.6 Sprite Animation System
Animation is data-driven:
```cpp
struct AnimationData {
std::string name;
std::vector<SDL_FRect> frames; // Frame rectangles
int speed; // Milliseconds per frame
int loop; // Frame to return to (-1 = no loop)
bool completed;
int current_frame;
int counter;
};
// Loaded from .ani files (list of animation names)
// Rendered with SurfaceAnimatedSprite
```
---
## 4. System Interactions & Data Flow
### 4.1 Application Lifecycle
```
main()
Director::Director() [Initialization]
├─ Resource::List::init() - Initialize asset registry singleton
├─ Director::setFileList() - Load assets.yaml configuration (no verification)
├─ Options::loadFromFile() - Load game configuration
├─ Audio::init() - Initialize SDL audio
├─ Screen::init() - Create window, SDL renderer
├─ Input::init() - Bind keyboard/gamepad controls
├─ Resource::Cache::init() - Load ALL game resources (with verification)
│ └─ Throws exception if any required asset is missing
└─ Cheevos::init() - Load achievement state
Director::run() [Main loop]
├─ while (SceneManager::current != QUIT)
│ ├─ Logo::run()
│ ├─ LoadingScreen::run()
│ ├─ Title::run()
│ ├─ Game::run()
│ ├─ Ending::run()
│ └─ ...
└─ return 0
Director::~Director() [Cleanup]
├─ Options::saveToFile() - Save game settings
├─ Resource::Cache::destroy()
├─ Audio::destroy()
├─ Input::destroy()
├─ Screen::destroy()
└─ Resource::List::destroy()
```
### 4.2 Game Scene Flow (Core Gameplay Loop)
```cpp
Game::run() {
while (game is running) {
// Update
Input::checkInput() - Get player commands
Player::update() - Physics, animation, collision
Room::update() - Enemy AI, animated tiles
checkCollisions() - Player vs enemies, items, room
checkGameOver() - Win/lose conditions
// Render
Screen::start() - Prepare for drawing
Room::renderMap() - Draw tilemap
Room::renderEnemies() - Draw enemy sprites
Room::renderItems() - Draw item sprites
Player::render() - Draw player sprite
renderScoreboard() - Draw HUD
Screen::render() - Flush to GPU
}
}
```
### 4.3 Resource Loading & Caching
```
Director::setFileList()
└─ Asset::loadFromFile(config_path, PREFIX, system_folder_)
├─ Read config/assets.yaml - Parse text configuration file
├─ Parse YAML structure: assets grouped by category
├─ Replace variables (${PREFIX}, ${SYSTEM_FOLDER})
└─ Store in unordered_map (O(1) lookup) - Fast asset path retrieval
Game Scene initialization
└─ Resource::Cache::init() - Loads all resources
├─ loadSounds() - WAV files (with error handling)
├─ loadMusics() - OGG files (with error handling)
├─ loadSurfaces() - GIF/PNG images (with error handling)
├─ loadPalettes() - PAL palette files (with error handling)
├─ loadTextFiles() - Font definition files (with error handling)
├─ loadAnimations() - YAML animation definitions (with error handling)
└─ loadRooms() - Room YAML files (with error handling)
Note: Asset verification happens during actual loading.
If a required file is missing, Cache::load() throws detailed exception.
During gameplay
└─ Resource::Cache::get*(name) - Return cached resource
```
### 4.4 Input Flow
```
SDL_Event (from OS)
Input::checkInput(action)
├─ Check keyboard bindings - SDL_Scancode → InputAction
├─ Check gamepad bindings - SDL_GamepadButton → InputAction
└─ Return true if action active
Game logic uses checked inputs
└─ Player responds to actions
```
### 4.5 Audio Control Flow
```
Game code
├─ Audio::playMusic(name, loop)
├─ Audio::playSound(name, group)
└─ Audio::stopMusic()
Audio [wrapper/manager]
├─ Resource::getMusic(name)
├─ Resource::getSound(name)
└─ jail_audio C library
└─ SDL3 Audio device
```
---
## 5. Important Design Patterns & Conventions
### 5.1 Naming Conventions
**Classes:**
- `PascalCase` for classes: `Player`, `Room`, `Screen`, `Director`
- Suffix `Sprite` for sprite classes: `SurfaceSprite`, `SurfaceAnimatedSprite`
**Methods:**
- `get*()` for getters: `getWidth()`, `getRect()`
- `set*()` for setters: `setColor()`, `setPos()`
- `check*()` for boolean checks: `checkInput()`, `checkCollision()`
- `update()` for game logic updates
- `render()` for drawing
**Variables:**
- `snake_case` for member variables with `_` suffix: `x_`, `y_`, `sprite_`
- `UPPER_CASE` for constants: `BLOCK`, `MAX_VY`, `WIDTH`
- Private members: `private_member_`
**Structs for Data:**
- `XxxData` suffix: `PlayerData`, `RoomData`, `AnimationData`
- Used as initialization structures passed to constructors
### 5.2 Memory Management
- **Smart Pointers:** Uses `std::shared_ptr` for shared ownership (Surfaces, Sprites, Rooms)
- **Unique Pointers:** Uses `std::unique_ptr` for sole ownership (Director, local objects)
- **Raw Pointers:** Minimal use, mainly for singleton access or SDL objects
- **Static Allocation:** Singletons use static pointer pattern for RAII
### 5.3 Frame-Independent Physics
Uses `DeltaTimer` for delta time calculation:
```cpp
// In game loop
float delta = deltaTimer.tick(); // Get seconds since last frame
// Apply to physics
player.vy_ += gravity * delta;
player.y_ += player.vy_ * delta;
```
Provides **time scaling** for slow-motion effects.
### 5.4 Palette System
- 8-bit indexed color (256 colors per palette)
- Multiple palettes can be loaded and swapped
- `Surface::setPalette()` changes rendering colors
- Supports color replacement per-render: `renderWithColorReplace()`
- CRT shader effects can modify colors in real-time
### 5.5 Configuration System
Game settings stored in configuration file:
```cpp
namespace Options {
inline Video video{}; // Screen resolution, fullscreen, etc.
inline Audio audio{}; // Music/sound volumes
inline Notification notifications{};
inline Cheat cheats{}; // Cheat codes
inline ControlScheme keys{}; // Control mapping
inline Stats stats{}; // Game statistics
}
Options::loadFromFile(path); // Load from config.yaml
Options::saveToFile(path); // Save on exit
```
### 5.6 Achievement System
```cpp
struct Achievement {
int id;
std::string caption;
std::string description;
int icon;
bool completed;
bool obtainable;
};
Cheevos::unlock(id); // Unlock achievement
Cheevos::setUnobtainable(id); // Lock achievement
Cheevos::saveToFile(); // Persist state
```
Achievements trigger notifications on unlock.
---
## 6. Technology Stack
### Core Technologies
| Component | Technology | Version | Role |
|-----------|-----------|---------|------|
| **Graphics** | SDL3 | Latest | Window, rendering, input |
| **GPU Rendering** | OpenGL | 3.2+ | Shader effects (CRT) |
| **Audio** | SDL3 Audio | Latest | Audio device, mixing |
| **Audio Decoding** | jail_audio (custom) | 1.x | OGG/WAV playback |
| **Image Loading** | stb_image | v2.x | PNG/GIF image loading |
| **Audio Decoding** | stb_vorbis | v1.x | OGG Vorbis support |
| **Language** | C++ | C++20 | Standard library features |
| **Build System** | CMake | 3.10+ | Cross-platform building |
### C++ Features Used
- **Smart Pointers:** `std::shared_ptr`, `std::unique_ptr`
- **Standard Containers:** `std::vector`, `std::array`
- **Modern Features:** `std::move`, lambda functions, constexpr
- **Namespaces:** Extensive use for organization
- **Inline Variables:** C++17 `inline` for global game state
### Platform Support
- **Windows:** MinGW/MSVC with SDL3
- **macOS:** Apple Clang, arm64 architecture, OpenGL
- **Linux:** GCC with SDL3 and OpenGL
---
## 7. Key Classes & Their Responsibilities
### Core System Classes
| Class | Purpose | Pattern |
|-------|---------|---------|
| `Director` | Main application controller, scene manager | Singleton |
| `Screen` | Rendering, window, palette management | Singleton |
| `Input` | Keyboard & gamepad input | Singleton |
| `Audio` | Music and SFX playback | Singleton |
| `Resource::Cache` | Asset caching and loading (with detailed error messages) | Singleton |
| `Resource::List` | Asset path registry from config/assets.yaml, O(1) lookups, variable substitution | Singleton |
| `Debug` | Debug overlay information | Singleton |
| `globalEvents` | Global SDL event handling (quit, device reset, mouse) | Namespace |
### Game Logic Classes
| Class | Purpose |
|-------|---------|
| `Game` | Main gameplay scene, orchestrates update/render |
| `Player` | Player entity with physics and animation |
| `Room` | Level data, collision detection, tilemap rendering |
| `Enemy` | Enemy entity behavior and rendering |
| `Item` | Collectible items |
| `Scoreboard` | HUD display data |
| `Cheevos` | Achievement unlock and state |
| `ItemTracker` | Tracks collected items |
| `RoomTracker` | Tracks visited rooms |
### Rendering Classes
| Class | Purpose |
|-------|---------|
| `Surface` | 8-bit indexed color pixel buffer with palette |
| `SurfaceSprite` | Renders a sprite region |
| `SurfaceAnimatedSprite` | Frame-based animation rendering |
| `SurfaceMovingSprite` | Sprite with velocity/position |
| `Text` | Text rendering system |
| `OpenGLShader` | Shader compilation and effects |
### Utility Classes
| Class | Purpose |
|-------|---------|
| `DeltaTimer` | Frame-rate independent timing |
---
## 8. Common Development Workflows
### Adding a New Input Action
1. Add to `InputAction` enum in `core/input/input.hpp`
2. Bind in `Director::initInput()`:
```cpp
Input::get()->bindKey(InputAction::NEW_ACTION, SDL_SCANCODE_X);
```
3. Check in game code:
```cpp
if (Input::get()->checkInput(InputAction::NEW_ACTION)) {
// Handle action
}
```
### Adding a New Scene
1. Create class inheriting appropriate base (usually standalone `run()` method)
2. Add to `SceneManager::Scene` enum
3. Implement in `Director::run()` switch statement
4. Set `SceneManager::current` to transition
### Adding Game Assets
1. Place file in `data/` directory
2. Add entry to `config/assets.yaml` under the appropriate category:
```yaml
assets:
category_name: # e.g., player, enemies, music, etc.
- type: BITMAP
path: ${PREFIX}/data/path/file.ext
```
Available types: `DATA`, `BITMAP`, `ANIMATION`, `MUSIC`, `SOUND`, `FONT`, `ROOM`, `PALETTE`
3. Optional flags can be added:
```yaml
- type: DATA
path: ${SYSTEM_FOLDER}/file.txt
required: false # Don't fail if missing
absolute: true # Path is absolute
```
4. Resource loads automatically during `Resource::init()`
5. Access via: `Resource::Cache::get()->getSurface("name")`
**Note:** No recompilation needed when adding/removing/modifying assets in `config/assets.yaml`
### Modifying Collision Detection
1. Update `Room::setBottomSurfaces()`, `setLeftSlopes()`, etc.
2. Modify Player collision point generation in `Player::updateColliderPoints()`
3. Adjust tile classification in `TileType` enum
4. Test with debug visualization (F12 key)
---
## 9. Debug Features
### Available at Runtime
- **F12** - Toggle debug info overlay (FPS, player position, collision points)
- **F1/F2** - Decrease/increase window zoom
- **F3** - Toggle fullscreen mode
- **F4** - Toggle shader effects
- **F5/F6** - Next/previous palette
- **F7** - Toggle integer scaling
- **M** - Toggle music
- **B** - Toggle border display
- **P** - Pause game
### Debug Mode Compilation
In debug builds (`#ifdef DEBUG`), renders:
- Player collision boxes
- Collision point visualization
- Debug information overlay
- Special debug event handling
---
## 10. Performance Considerations
### Optimization Points
1. **Rendering:** Uses indexed color (8-bit) to reduce memory bandwidth
2. **Surfaces:** Shared smart pointers reduce copying
3. **Collision:** Pre-computed tile surface lists avoid per-frame searches
4. **Animation:** Frame-based animation reduces computation vs. bone systems
5. **Audio:** Cached music and sound effects, no runtime decoding
6. **Delta Time:** Frame-rate independent logic for smooth gameplay
### Known Limitations
- Single-threaded architecture (SDL3 requires single-thread rendering)
- Surfaces stored entirely in CPU memory (not GPU-side textures)
- Palette system requires full surface redraw when changing colors
---
## 11. File Format Reference
### Asset Configuration File (config/assets.yaml)
YAML-based asset registry with grouped structure:
```yaml
# JailDoctor's Dilemma - Asset Configuration
# Variables: ${PREFIX}, ${SYSTEM_FOLDER}
assets:
# FONTS
fonts:
- type: BITMAP
path: ${PREFIX}/data/font/smb2.gif
- type: FONT
path: ${PREFIX}/data/font/smb2.txt
# PLAYER
player:
- type: BITMAP
path: ${PREFIX}/data/player/player.gif
- type: ANIMATION
path: ${PREFIX}/data/player/player.yaml
# MUSIC
music:
- type: MUSIC
path: ${PREFIX}/data/music/title.ogg
# SYSTEM FILES (optional, absolute paths)
system:
- type: DATA
path: ${SYSTEM_FOLDER}/config.yaml
required: false
absolute: true
```
**Asset Structure:**
- Assets are organized into categories (fonts, palettes, shaders, player, enemies, etc.)
- Each asset entry contains:
- `type` - Asset type (required)
- `path` - File path with variable substitution (required)
- `required` - Whether file must exist (optional, default: `true`)
- `absolute` - Whether path is absolute (optional, default: `false`)
**Available Asset Types:**
- `DATA` - General data files (text, JSON, etc.)
- `BITMAP` - Images (GIF, PNG)
- `ANIMATION` - Animation definition files (.yaml)
- `MUSIC` - Music files (OGG)
- `SOUND` - Sound effects (WAV)
- `FONT` - Font definition files
- `ROOM` - Room data files (.yaml)
- `PALETTE` - Color palette files (.pal)
**Variables:**
- `${PREFIX}` - Replaced with `/../Resources` on macOS bundles, empty otherwise
- `${SYSTEM_FOLDER}` - Replaced with user's system config folder
### Animation Files (.ani)
List of animation names, one per line:
```
default
jump
run
fall
```
### Room Data Files (.room)
Key-value pairs defining room properties:
```
number=01
name=Starting Room
bg_color=0x000000
border_color=0xFF00FF
...
```
### Tilemap Files (.tmx)
Tiled map format with tileset and collision data.
### Palette Files (.pal)
Binary 256-color palette format (256 × 4 bytes RGBA).
---
## 12. Quick Reference: Main Entry Points
### For Graphics Issues
- `Screen::render()` - Main rendering method
- `Screen::setPalete()` - Palette application
- `Surface` class - Pixel buffer operations
### For Input Issues
- `Input::checkInput()` - Input state checking
- `Director::initInput()` - Binding configuration
### For Audio Issues
- `Audio::playMusic()` - Music playback
- `Audio::playSound()` - SFX playback
- `jail_audio` library - Low-level audio operations
### For Game Logic
- `Game::run()` - Main game loop
- `Room` class - Collision and level logic
- `Player::update()` - Physics and movement
### For Asset Management
- `config/assets.yaml` - Asset configuration file (text-based, no recompilation needed)
- `Asset::loadFromFile()` - Loads assets from config file
- `Resource::List::get()` - Retrieves asset path (O(1) lookup with unordered_map)
- `Resource::load()` - Asset loading
- `Director::setFileList()` - Calls `Asset::loadFromFile()` with PREFIX and system_folder
---
## 13. Future Enhancement Points
### Identified Areas for Expansion
1. **Network Play:** Stats upload to online service
2. **More Scenes:** Additional game modes
3. **Custom Rooms:** Level editor integration
4. **Audio Streaming:** Background music without loading entire file
5. **Particle System:** Visual effects for pickups/collisions
6. **Controller Feedback:** Haptic feedback for game events
7. **Accessibility:** Font scaling, color-blind modes, key remapping UI
---
## Development Notes
- **Language:** All code comments and some variable names are in Spanish (maintaining original author style)
- **Compilation:** Use CMake - automatically handles platform differences
- **Performance Profiling:** Use debug overlay (F12) for basic metrics; consider external profilers for deeper analysis
- **Common Warnings:** The codebase has been cleaned of the `struct`/`class` forward declaration inconsistency warnings that previously appeared
### Important Code Consistency Rules
1. **Forward Declarations:** Always use `class` for forward declarations of classes defined with `class` (not `struct`). The `Surface` class is defined as `class Surface` in `surface.hpp:57`, so all forward declarations must use `class Surface;`
2. **Singleton Pattern:** When creating new singletons, follow the existing pattern:
- Private static instance pointer
- Private constructor/destructor
- Public `init()`, `destroy()`, and `get()` methods
3. **Delta Time:** Always use `DeltaTimer` for frame-rate independent physics calculations
4. **Memory Management:** Prefer `std::shared_ptr` for shared resources (Surfaces, Sprites) and `std::unique_ptr` for sole ownership
---
**Last Updated:** November 2022 (per README)
**Original Author:** JailDesigner
**Repository:** Gitea (internal)

238
CMakeLists.txt Normal file
View File

@@ -0,0 +1,238 @@
# CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(jaildoctors_dilemma VERSION 1.00)
# Establecer estándar de C++
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Exportar comandos de compilación para herramientas de análisis
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Establece la política CMP0072 para indicar cómo se debe seleccionar la implementación de OpenGL.
# En este caso, se elige la opción "GLVND", que utiliza bibliotecas modernas y modulares (libOpenGL, libGLX),
# en lugar de la biblioteca OpenGL clásica (libGL). Esto mejora la compatibilidad con drivers recientes
# y evita ambigüedades cuando se encuentran múltiples implementaciones de OpenGL en el sistema.
cmake_policy(SET CMP0072 NEW)
set(OpenGL_GL_PREFERENCE GLVND)
# --- GENERACIÓN DE VERSIÓN AUTOMÁTICA ---
find_package(Git QUIET)
if(GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short=7 HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
else()
set(GIT_HASH "unknown")
endif()
# Configurar archivo de versión
configure_file(${CMAKE_SOURCE_DIR}/source/version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)
# --- 1. LISTA EXPLÍCITA DE FUENTES ---
set(APP_SOURCES
# Core - Audio
source/core/audio/audio.cpp
# Core - Input
source/core/input/global_inputs.cpp
source/core/input/input.cpp
source/core/input/input_types.cpp
source/core/input/mouse.cpp
# Core - Rendering
source/core/rendering/gif.cpp
source/core/rendering/screen.cpp
source/core/rendering/surface.cpp
source/core/rendering/surface_animated_sprite.cpp
source/core/rendering/surface_moving_sprite.cpp
source/core/rendering/surface_sprite.cpp
source/core/rendering/text.cpp
source/core/rendering/texture.cpp
# Core - Resources
source/core/resources/resource_list.cpp
source/core/resources/resource_cache.cpp
source/core/resources/resource_pack.cpp
source/core/resources/resource_loader.cpp
source/core/resources/resource_helper.cpp
# Core - System
source/core/system/director.cpp
source/core/system/global_events.cpp
# Game - Entities
source/game/entities/enemy.cpp
source/game/entities/item.cpp
source/game/entities/player.cpp
# Game - Configuration
source/game/options.cpp
# Game - Gameplay
source/game/gameplay/cheevos.cpp
source/game/gameplay/collision_map.cpp
source/game/gameplay/enemy_manager.cpp
source/game/gameplay/item_manager.cpp
source/game/gameplay/item_tracker.cpp
source/game/gameplay/room.cpp
source/game/gameplay/room_loader.cpp
source/game/gameplay/room_tracker.cpp
source/game/gameplay/scoreboard.cpp
source/game/gameplay/stats.cpp
source/game/gameplay/tilemap_renderer.cpp
# Game - Scenes
source/game/scenes/credits.cpp
source/game/scenes/ending.cpp
source/game/scenes/ending2.cpp
source/game/scenes/game.cpp
source/game/scenes/game_over.cpp
source/game/scenes/loading_screen.cpp
source/game/scenes/logo.cpp
source/game/scenes/title.cpp
# Game - UI
source/game/ui/notifier.cpp
# Utils
source/utils/delta_timer.cpp
source/utils/utils.cpp
# Main
source/main.cpp
)
# Fuentes del sistema de renderizado
set(RENDERING_SOURCES
source/core/rendering/opengl/opengl_shader.cpp
)
# Fuentes de debug (solo en modo Debug)
set(DEBUG_SOURCES
source/core/system/debug.cpp
)
# Configuración de SDL3
find_package(SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
message(STATUS "SDL3 encontrado: ${SDL3_INCLUDE_DIRS}")
# --- 2. AÑADIR EJECUTABLE ---
add_executable(${PROJECT_NAME} ${APP_SOURCES} ${RENDERING_SOURCES})
# Añadir fuentes de debug solo en modo Debug
target_sources(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:${DEBUG_SOURCES}>)
# --- 3. DIRECTORIOS DE INCLUSIÓN ---
target_include_directories(${PROJECT_NAME} PUBLIC
"${CMAKE_SOURCE_DIR}/source"
"${CMAKE_BINARY_DIR}"
)
# Enlazar las librerías SDL3
target_link_libraries(${PROJECT_NAME} PRIVATE SDL3::SDL3)
# --- 4. CONFIGURACIÓN PLATAFORMAS Y COMPILADOR ---
# Configuración de flags de compilación
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:-Os -ffunction-sections -fdata-sections>)
# Definir _DEBUG en modo Debug y RELEASE_BUILD en modo Release
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:DEBUG>:_DEBUG>)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:RELEASE>:RELEASE_BUILD>)
# Configuración específica para cada plataforma
if(WIN32)
target_compile_definitions(${PROJECT_NAME} PRIVATE WINDOWS_BUILD)
target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32 mingw32 opengl32)
elseif(APPLE)
target_compile_definitions(${PROJECT_NAME} PRIVATE MACOS_BUILD)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-deprecated)
set(CMAKE_OSX_ARCHITECTURES "arm64")
elseif(UNIX AND NOT APPLE)
target_compile_definitions(${PROJECT_NAME} PRIVATE LINUX_BUILD)
endif()
# Configuración común para OpenGL
if(NOT WIN32)
find_package(OpenGL REQUIRED)
if(OPENGL_FOUND)
message(STATUS "OpenGL encontrado: ${OPENGL_LIBRARIES}")
target_link_libraries(${PROJECT_NAME} PRIVATE ${OPENGL_LIBRARIES})
else()
message(FATAL_ERROR "OpenGL no encontrado")
endif()
endif()
# Especificar la ubicación del ejecutable
set_target_properties(${PROJECT_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
# --- 5. STATIC ANALYSIS TARGETS ---
# Buscar herramientas de análisis estático
find_program(CLANG_TIDY_EXE NAMES clang-tidy)
find_program(CLANG_FORMAT_EXE NAMES clang-format)
# Recopilar todos los archivos fuente para formateo
file(GLOB_RECURSE ALL_SOURCE_FILES
"${CMAKE_SOURCE_DIR}/source/*.cpp"
"${CMAKE_SOURCE_DIR}/source/*.hpp"
"${CMAKE_SOURCE_DIR}/source/*.h"
)
# Excluir directorio external del análisis
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX ".*/external/.*")
# Para clang-tidy, también excluir jail_audio.hpp
set(CLANG_TIDY_SOURCES ${ALL_SOURCE_FILES})
list(FILTER CLANG_TIDY_SOURCES EXCLUDE REGEX ".*jail_audio\\.hpp$")
# Targets de clang-tidy
if(CLANG_TIDY_EXE)
add_custom_target(tidy
COMMAND ${CLANG_TIDY_EXE}
-p ${CMAKE_BINARY_DIR}
${CLANG_TIDY_SOURCES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running clang-tidy..."
)
add_custom_target(tidy-fix
COMMAND ${CLANG_TIDY_EXE}
-p ${CMAKE_BINARY_DIR}
--fix
${CLANG_TIDY_SOURCES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running clang-tidy with fixes..."
)
else()
message(STATUS "clang-tidy no encontrado - targets 'tidy' y 'tidy-fix' no disponibles")
endif()
# Targets de clang-format
if(CLANG_FORMAT_EXE)
add_custom_target(format
COMMAND ${CLANG_FORMAT_EXE}
-i
${ALL_SOURCE_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Running clang-format..."
)
add_custom_target(format-check
COMMAND ${CLANG_FORMAT_EXE}
--dry-run
--Werror
${ALL_SOURCE_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Checking clang-format..."
)
else()
message(STATUS "clang-format no encontrado - targets 'format' y 'format-check' no disponibles")
endif()

239
LICENSE
View File

@@ -1,232 +1,21 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (c) 2022 JailDoctor's Dilemma
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Preamble
You are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material
The GNU General Public License is a free, copyleft license for software and other kinds of works.
Under the following terms:
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- NonCommercial — You may not use the material for commercial purposes.
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To view a copy of this license, visit:
https://creativecommons.org/licenses/by-nc-sa/4.0/
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

456
Makefile
View File

@@ -1,139 +1,401 @@
executable = jaildoctors_dilemma
source = source/*.cpp source/common/*.cpp
appName = JailDoctor's Dilemma
releaseFolder = jdd_release
version = v1.06
# ==============================================================================
# DIRECTORIES
# ==============================================================================
DIR_ROOT := $(dir $(abspath $(MAKEFILE_LIST)))
DIR_SOURCES := $(addsuffix /, $(DIR_ROOT)source)
DIR_BIN := $(addsuffix /, $(DIR_ROOT))
DIR_TOOLS := $(addsuffix /, $(DIR_ROOT)tools)
# Release names
windowsRelease = $(executable)-$(version)-win32-x64.zip
macosIntelRelease = $(executable)-$(version)-macos-intel.dmg
macosAppleSiliconRelease = $(executable)-$(version)-macos-apple-silicon.dmg
linuxRelease = $(executable)-$(version)-linux.tar.gz
# ==============================================================================
# TARGET NAMES
# ==============================================================================
TARGET_NAME := jaildoctors_dilemma
TARGET_FILE := $(DIR_BIN)$(TARGET_NAME)
APP_NAME := JailDoctor's Dilemma
RELEASE_FOLDER := jdd_release
RELEASE_FILE := $(RELEASE_FOLDER)/$(TARGET_NAME)
RESOURCE_FILE := release/jdd.res
# ==============================================================================
# PACKING TOOL
# ==============================================================================
ifeq ($(OS),Windows_NT)
PACK_TOOL := $(DIR_TOOLS)pack_resources/pack_resources.exe
PACK_CXX := $(CXX)
else
PACK_TOOL := $(DIR_TOOLS)pack_resources/pack_resources
PACK_CXX := $(CXX)
endif
PACK_SOURCES := $(DIR_TOOLS)pack_resources/pack_resources.cpp source/core/resources/resource_pack.cpp
PACK_INCLUDES := -Isource
# ==============================================================================
# VERSION (extracted from defines.hpp)
# ==============================================================================
ifeq ($(OS),Windows_NT)
VERSION := v$(shell powershell -Command "(Select-String -Path 'source/utils/defines.hpp' -Pattern 'constexpr const char\* VERSION = \"(.+?)\"').Matches.Groups[1].Value")
else
VERSION := v$(shell grep 'constexpr const char\* VERSION' source/utils/defines.hpp | sed -E 's/.*VERSION = "([^"]+)".*/\1/')
endif
# ==============================================================================
# WINDOWS-SPECIFIC VARIABLES
# ==============================================================================
ifeq ($(OS),Windows_NT)
WIN_TARGET_FILE := $(DIR_BIN)$(APP_NAME)
WIN_RELEASE_FILE := $(RELEASE_FOLDER)/$(APP_NAME)
else
WIN_TARGET_FILE := $(TARGET_FILE)
WIN_RELEASE_FILE := $(RELEASE_FILE)
endif
# ==============================================================================
# RELEASE NAMES
# ==============================================================================
WINDOWS_RELEASE := $(TARGET_NAME)-$(VERSION)-win32-x64.zip
MACOS_INTEL_RELEASE := $(TARGET_NAME)-$(VERSION)-macos-intel.dmg
MACOS_APPLE_SILICON_RELEASE := $(TARGET_NAME)-$(VERSION)-macos-apple-silicon.dmg
LINUX_RELEASE := $(TARGET_NAME)-$(VERSION)-linux.tar.gz
# ==============================================================================
# SOURCE FILES
# ==============================================================================
APP_SOURCES := \
source/main.cpp \
source/core/audio/audio.cpp \
source/core/input/input.cpp \
source/core/input/input_types.cpp \
source/core/input/mouse.cpp \
source/core/input/global_inputs.cpp \
source/core/rendering/screen.cpp \
source/core/rendering/surface.cpp \
source/core/rendering/surface_sprite.cpp \
source/core/rendering/surface_animated_sprite.cpp \
source/core/rendering/surface_moving_sprite.cpp \
source/core/rendering/text.cpp \
source/core/rendering/texture.cpp \
source/core/rendering/gif.cpp \
source/core/rendering/opengl/opengl_shader.cpp \
source/core/resources/resource_list.cpp \
source/core/resources/resource_cache.cpp \
source/core/resources/resource_helper.cpp \
source/core/resources/resource_loader.cpp \
source/core/resources/resource_pack.cpp \
source/core/system/director.cpp \
source/core/system/debug.cpp \
source/core/system/global_events.cpp \
source/game/options.cpp \
source/game/entities/player.cpp \
source/game/entities/enemy.cpp \
source/game/entities/item.cpp \
source/game/gameplay/room.cpp \
source/game/gameplay/collision_map.cpp \
source/game/gameplay/enemy_manager.cpp \
source/game/gameplay/item_manager.cpp \
source/game/gameplay/room_loader.cpp \
source/game/gameplay/tilemap_renderer.cpp \
source/game/gameplay/scoreboard.cpp \
source/game/gameplay/cheevos.cpp \
source/game/gameplay/item_tracker.cpp \
source/game/gameplay/room_tracker.cpp \
source/game/gameplay/stats.cpp \
source/game/scenes/logo.cpp \
source/game/scenes/loading_screen.cpp \
source/game/scenes/title.cpp \
source/game/scenes/game.cpp \
source/game/scenes/game_over.cpp \
source/game/scenes/ending.cpp \
source/game/scenes/ending2.cpp \
source/game/scenes/credits.cpp \
source/game/ui/notifier.cpp \
source/utils/utils.cpp \
source/utils/delta_timer.cpp
# All sources combined
ALL_SOURCES := $(APP_SOURCES)
# ==============================================================================
# INCLUDES
# ==============================================================================
INCLUDES := -Isource
# ==============================================================================
# COMPILER FLAGS (OS-specific)
# ==============================================================================
CPP_STANDARD := c++20
ifeq ($(OS),Windows_NT)
FixPath = $(subst /,\\,$1)
CXXFLAGS := -std=$(CPP_STANDARD) -Wall -Os -ffunction-sections -fdata-sections \
-Wl,--gc-sections -static-libstdc++ -static-libgcc \
-Wl,-subsystem,windows -DWINDOWS_BUILD
CXXFLAGS_DEBUG := -std=$(CPP_STANDARD) -Wall -g -D_DEBUG -DWINDOWS_BUILD
LDFLAGS := -lmingw32 -lws2_32 -lSDL3 -lopengl32
RM := del /Q
MKDIR := mkdir
else
FixPath = $1
CXXFLAGS := -std=$(CPP_STANDARD) -Wall -Os -ffunction-sections -fdata-sections
CXXFLAGS_DEBUG := -std=$(CPP_STANDARD) -Wall -g -D_DEBUG
LDFLAGS := -lSDL3
RMFILE := rm -f
RMDIR := rm -rdf
MKDIR := mkdir -p
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
CXXFLAGS += -DLINUX_BUILD
LDFLAGS += -lGL
endif
ifeq ($(UNAME_S),Darwin)
CXXFLAGS += -Wno-deprecated -DMACOS_BUILD
CXXFLAGS_DEBUG += -Wno-deprecated -DMACOS_BUILD
LDFLAGS += -framework OpenGL
# Configurar arquitectura (por defecto arm64)
CXXFLAGS += -arch arm64
CXXFLAGS_DEBUG += -arch arm64
endif
endif
# ==============================================================================
# REGLAS PARA HERRAMIENTA DE EMPAQUETADO Y RESOURCES.PACK
# ==============================================================================
$(PACK_TOOL): FORCE
@echo "Compilando herramienta de empaquetado..."
$(PACK_CXX) -std=$(CPP_STANDARD) -Wall -Os $(PACK_INCLUDES) $(PACK_SOURCES) -o $(PACK_TOOL)
@echo "✓ Herramienta de empaquetado lista: $(PACK_TOOL)"
pack_tool: $(PACK_TOOL)
resources.pack: $(PACK_TOOL)
@echo "Generando resources.pack desde directorio data/..."
$(PACK_TOOL) data resources.pack
@echo "✓ resources.pack generado exitosamente"
# ==============================================================================
# COMPILACIÓN PARA WINDOWS
# ==============================================================================
windows:
@echo off
g++ $(source) -std=c++11 -Wall -Os -lmingw32 -lws2_32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(executable).exe"
strip -s -R .comment -R .gnu.version "$(executable).exe" --strip-unneeded
@echo Compilando para Windows con nombre: "$(WIN_TARGET_FILE).exe"
windres release/jdd.rc -O coff -o $(RESOURCE_FILE)
g++ $(ALL_SOURCES) $(RESOURCE_FILE) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_TARGET_FILE).exe"
strip -s -R .comment -R .gnu.version "$(WIN_TARGET_FILE).exe" --strip-unneeded
windows_debug:
@echo off
g++ $(source) -D DEBUG -std=c++11 -Wall -Os -lmingw32 -lws2_32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(executable)_debug.exe"
strip -s -R .comment -R .gnu.version "$(executable)_debug.exe" --strip-unneeded
@echo Compilando version debug para Windows: "$(WIN_TARGET_FILE)_debug.exe"
g++ $(ALL_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(WIN_TARGET_FILE)_debug.exe"
windows_release:
@$(MAKE) pack_tool
@$(MAKE) resources.pack
@echo off
@echo Creando release para Windows - Version: $(VERSION)
# Create release folder
powershell if (Test-Path "$(releaseFolder)") {Remove-Item "$(releaseFolder)" -Recurse -Force}
powershell if (-not (Test-Path "$(releaseFolder)")) {New-Item "$(releaseFolder)" -ItemType Directory}
# Generate version.h from version.h.in
@echo "Generando version.h..."
@powershell -Command "$$GIT_HASH = (git rev-parse --short=7 HEAD 2>$$null); if (-not $$GIT_HASH) { $$GIT_HASH = 'unknown' }; (Get-Content source/version.h.in) -replace '@GIT_HASH@', $$GIT_HASH | Set-Content source/version.h"
# Prepare data folder
powershell Copy-Item -Path "data" -Destination "$(releaseFolder)" -recurse -Force
powershell if (Test-Path "$(releaseFolder)\data\room\map.world") {Remove-Item "$(releaseFolder)\data\room\map.world" -Recurse -Force}
powershell if (Test-Path "$(releaseFolder)\data\room\standard.tsx") {Remove-Item "$(releaseFolder)\data\room\standard.tsx" -Recurse -Force}
# Copy root files
powershell Copy-Item "LICENSE" -Destination "$(releaseFolder)"
powershell Copy-Item "README.md" -Destination "$(releaseFolder)"
powershell Copy-Item "release\SDL2.dll" -Destination "$(releaseFolder)"
# Crea carpeta temporal 'RELEASE_FOLDER'
powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force}
powershell if (-not (Test-Path "$(RELEASE_FOLDER)")) {New-Item "$(RELEASE_FOLDER)" -ItemType Directory}
# Build
g++ $(source) -std=c++11 -Wall -Os -lmingw32 -lws2_32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o "$(releaseFolder)/$(executable).exe"
strip -s -R .comment -R .gnu.version "$(releaseFolder)/$(executable).exe" --strip-unneeded
# Copia el archivo 'resources.pack'
powershell Copy-Item -Path "resources.pack" -Destination "$(RELEASE_FOLDER)"
# Create ZIP
powershell if (Test-Path $(windowsRelease)) {Remove-Item $(windowsRelease)}
powershell Compress-Archive -Path "$(releaseFolder)"/* -DestinationPath $(windowsRelease)
# Copia los ficheros que están en la raíz del proyecto
powershell Copy-Item "LICENSE" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "README.md" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "gamecontrollerdb.txt" -Destination "$(RELEASE_FOLDER)"
powershell Copy-Item "release\*.dll" -Destination "$(RELEASE_FOLDER)"
# Remove folder
powershell if (Test-Path "$(releaseFolder)") {Remove-Item "$(releaseFolder)" -Recurse -Force}
# Compila (con icono)
windres release/jdd.rc -O coff -o $(RESOURCE_FILE)
g++ $(ALL_SOURCES) $(RESOURCE_FILE) $(INCLUDES) -DRELEASE_BUILD $(CXXFLAGS) $(LDFLAGS) -o "$(WIN_RELEASE_FILE).exe"
strip -s -R .comment -R .gnu.version "$(WIN_RELEASE_FILE).exe" --strip-unneeded
# Crea el fichero .zip
powershell if (Test-Path "$(WINDOWS_RELEASE)") {Remove-Item "$(WINDOWS_RELEASE)"}
powershell Compress-Archive -Path "$(RELEASE_FOLDER)"/* -DestinationPath "$(WINDOWS_RELEASE)"
@echo Release creado: $(WINDOWS_RELEASE)
# Elimina la carpeta temporal 'RELEASE_FOLDER'
powershell if (Test-Path "$(RELEASE_FOLDER)") {Remove-Item "$(RELEASE_FOLDER)" -Recurse -Force}
# ==============================================================================
# COMPILACIÓN PARA MACOS
# ==============================================================================
macos:
clang++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -o "$(executable)"
@echo "Compilando para macOS: $(TARGET_NAME)"
clang++ $(ALL_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
macos_debug:
clang++ $(source) -D DEBUG -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -o "$(executable)_debug"
@echo "Compilando version debug para macOS: $(TARGET_NAME)_debug"
clang++ $(ALL_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
macos_release:
# Remove data and possible data from previous builds
rm -rdf "$(releaseFolder)"
rm -rdf Frameworks
rm -f tmp.dmg
rm -f "$(macosIntelRelease)"
rm -f "$(macosAppleSiliconRelease)"
@$(MAKE) pack_tool
@$(MAKE) resources.pack
@echo "Creando release para macOS - Version: $(VERSION)"
# Create folders
mkdir -p "$(releaseFolder)/$(appName).app/Contents/Frameworks"
mkdir -p "$(releaseFolder)/$(appName).app/Contents/MacOS"
mkdir -p "$(releaseFolder)/$(appName).app/Contents/Resources"
mkdir -p Frameworks
# Verificar e instalar create-dmg si es necesario
@which create-dmg > /dev/null || (echo "Instalando create-dmg..." && brew install create-dmg)
# Copy folders
cp -R data "$(releaseFolder)/$(appName).app/Contents/Resources"
cp -R release/SDL2.framework "$(releaseFolder)/$(appName).app/Contents/Frameworks"
cp -R release/SDL2.framework Frameworks
# Generate version.h from version.h.in
@echo "Generando version.h..."
@GIT_HASH=$$(git rev-parse --short=7 HEAD 2>/dev/null || echo "unknown"); \
sed "s/@GIT_HASH@/$$GIT_HASH/g" source/version.h.in > source/version.h
# Delete data
rm -f "$(releaseFolder)/$(appName).app/Contents/Resources/data/room/map.world"
rm -f "$(releaseFolder)/$(appName).app/Contents/Resources/data/room/standard.tsx"
# Elimina datos de compilaciones anteriores
$(RMDIR) "$(RELEASE_FOLDER)"
$(RMDIR) Frameworks
$(RMFILE) tmp.dmg
$(RMFILE) "$(MACOS_INTEL_RELEASE)"
$(RMFILE) "$(MACOS_APPLE_SILICON_RELEASE)"
# Copy files
cp release/*.icns "$(releaseFolder)/$(appName).app/Contents/Resources"
cp release/Info.plist "$(releaseFolder)/$(appName).app/Contents"
cp LICENSE "$(releaseFolder)"
cp README.md "$(releaseFolder)"
# Crea la carpeta temporal para hacer el trabajo y las carpetas obligatorias para crear una app de macOS
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS"
$(MKDIR) "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
$(MKDIR) Frameworks
# Build INTEL
clang++ $(source) -D MACOS_BUNDLE -std=c++11 -Wall -Os -framework SDL2 -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.12
# Copia carpetas y ficheros
cp resources.pack "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp gamecontrollerdb.txt "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp -R release/frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Frameworks"
cp -R release/frameworks/SDL3.xcframework/macos-arm64_x86_64/SDL3.framework Frameworks
cp release/*.icns "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Resources"
cp release/Info.plist "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents"
cp LICENSE "$(RELEASE_FOLDER)"
cp README.md "$(RELEASE_FOLDER)"
# Build INTEL DMG
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
hdiutil convert tmp.dmg -format UDZO -o "$(macosIntelRelease)"
rm -f tmp.dmg
# Actualiza versión en Info.plist
@echo "Actualizando Info.plist con versión $(VERSION)..."
@RAW_VERSION=$$(echo "$(VERSION)" | sed 's/^v//'); \
sed -i '' '/<key>CFBundleShortVersionString<\/key>/{n;s|<string>.*</string>|<string>'"$$RAW_VERSION"'</string>|;}' "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Info.plist"; \
sed -i '' '/<key>CFBundleVersion<\/key>/{n;s|<string>.*</string>|<string>'"$$RAW_VERSION"'</string>|;}' "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/Info.plist"
# Build APPLE SILICON
clang++ $(source) -D MACOS_BUNDLE -std=c++11 -Wall -Os -framework SDL2 -F ./Frameworks -ffunction-sections -fdata-sections -o "$(releaseFolder)/$(appName).app/Contents/MacOS/$(executable)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
# Compila la versión para procesadores Intel
clang++ $(ALL_SOURCES) $(INCLUDES) -DMACOS_BUNDLE -DRELEASE_BUILD -std=$(CPP_STANDARD) -Wall -Os -framework SDL3 -F ./Frameworks -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target x86_64-apple-macos10.15
# Build APPLE SILICON DMG
hdiutil create tmp.dmg -ov -volname "$(appName)" -fs HFS+ -srcfolder "$(releaseFolder)"
hdiutil convert tmp.dmg -format UDZO -o "$(macosAppleSiliconRelease)"
rm -f tmp.dmg
# Firma la aplicación
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
# Remove data
rm -rdf Frameworks
rm -rdf "$(releaseFolder)"
# Empaqueta el .dmg de la versión Intel con create-dmg
@echo "Creando DMG Intel con iconos de 96x96..."
create-dmg \
--volname "$(APP_NAME)" \
--window-pos 200 120 \
--window-size 720 300 \
--icon-size 96 \
--text-size 12 \
--icon "$(APP_NAME).app" 278 102 \
--icon "LICENSE" 441 102 \
--icon "README.md" 604 102 \
--app-drop-link 115 102 \
--hide-extension "$(APP_NAME).app" \
"$(MACOS_INTEL_RELEASE)" \
"$(RELEASE_FOLDER)" || true
@echo "Release Intel creado: $(MACOS_INTEL_RELEASE)"
# Compila la versión para procesadores Apple Silicon
clang++ $(ALL_SOURCES) $(INCLUDES) -DMACOS_BUNDLE -DRELEASE_BUILD -std=$(CPP_STANDARD) -Wall -Os -framework SDL3 -F ./Frameworks -framework OpenGL -Wno-deprecated -ffunction-sections -fdata-sections -o "$(RELEASE_FOLDER)/$(APP_NAME).app/Contents/MacOS/$(TARGET_NAME)" -rpath @executable_path/../Frameworks/ -target arm64-apple-macos11
# Firma la aplicación
codesign --deep --force --sign - --timestamp=none "$(RELEASE_FOLDER)/$(APP_NAME).app"
# Empaqueta el .dmg de la versión Apple Silicon con create-dmg
@echo "Creando DMG Apple Silicon con iconos de 96x96..."
create-dmg \
--volname "$(APP_NAME)" \
--window-pos 200 120 \
--window-size 720 300 \
--icon-size 96 \
--text-size 12 \
--icon "$(APP_NAME).app" 278 102 \
--icon "LICENSE" 441 102 \
--icon "README.md" 604 102 \
--app-drop-link 115 102 \
--hide-extension "$(APP_NAME).app" \
"$(MACOS_APPLE_SILICON_RELEASE)" \
"$(RELEASE_FOLDER)" || true
@echo "Release Apple Silicon creado: $(MACOS_APPLE_SILICON_RELEASE)"
# Elimina las carpetas temporales
$(RMDIR) Frameworks
$(RMDIR) "$(RELEASE_FOLDER)"
# ==============================================================================
# COMPILACIÓN PARA LINUX
# ==============================================================================
linux:
g++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(executable)"
strip -s -R .comment -R .gnu.version "$(executable)" --strip-unneeded
@echo "Compilando para Linux: $(TARGET_NAME)"
g++ $(ALL_SOURCES) $(INCLUDES) $(CXXFLAGS) $(LDFLAGS) -o "$(TARGET_FILE)"
strip -s -R .comment -R .gnu.version "$(TARGET_FILE)" --strip-unneeded
linux_debug:
g++ $(source) -D DEBUG -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(executable)_debug"
strip -s -R .comment -R .gnu.version "$(executable)_debug" --strip-unneeded
@echo "Compilando version debug para Linux: $(TARGET_NAME)_debug"
g++ $(ALL_SOURCES) $(INCLUDES) -DDEBUG -DVERBOSE $(CXXFLAGS_DEBUG) $(LDFLAGS) -o "$(TARGET_FILE)_debug"
linux_release:
# Remove data
rm -rdf "$(releaseFolder)"
@$(MAKE) pack_tool
@$(MAKE) resources.pack
@echo "Creando release para Linux - Version: $(VERSION)"
# Create folders
mkdir -p "$(releaseFolder)"
# Generate version.h from version.h.in
@echo "Generando version.h..."
@GIT_HASH=$$(git rev-parse --short=7 HEAD 2>/dev/null || echo "unknown"); \
sed "s/@GIT_HASH@/$$GIT_HASH/g" source/version.h.in > source/version.h
# Copy data
cp -R data "$(releaseFolder)"
cp LICENSE "$(releaseFolder)"
cp README.md "$(releaseFolder)"
# Elimina carpetas previas
$(RMDIR) "$(RELEASE_FOLDER)"
# Delete data
rm -f "$(releaseFolder)/data/room/map.world"
rm -f "$(releaseFolder)/data/room/standard.tsx"
# Crea la carpeta temporal para realizar el lanzamiento
$(MKDIR) "$(RELEASE_FOLDER)"
# Build
g++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o "$(releaseFolder)/$(executable)"
strip -s -R .comment -R .gnu.version "$(releaseFolder)/$(executable)" --strip-unneeded
# Copia ficheros
cp resources.pack "$(RELEASE_FOLDER)"
cp LICENSE "$(RELEASE_FOLDER)"
cp README.md "$(RELEASE_FOLDER)"
cp gamecontrollerdb.txt "$(RELEASE_FOLDER)"
# Pack files
rm -f "$(linuxRelease)"
cd "$(releaseFolder)" && tar -czvf "../$(linuxRelease)" *
# Compila
g++ $(ALL_SOURCES) $(INCLUDES) -DRELEASE_BUILD $(CXXFLAGS) $(LDFLAGS) -o "$(RELEASE_FILE)"
strip -s -R .comment -R .gnu.version "$(RELEASE_FILE)" --strip-unneeded
# Remove data
rm -rdf "$(releaseFolder)"
# Empaqueta ficheros
$(RMFILE) "$(LINUX_RELEASE)"
tar -czvf "$(LINUX_RELEASE)" -C "$(RELEASE_FOLDER)" .
@echo "Release creado: $(LINUX_RELEASE)"
# Elimina la carpeta temporal
$(RMDIR) "$(RELEASE_FOLDER)"
# ==============================================================================
# REGLAS ESPECIALES
# ==============================================================================
# Regla para mostrar la versión actual
show_version:
@echo "Version actual: $(VERSION)"
# Regla de ayuda
help:
@echo "Makefile para JailDoctor's Dilemma"
@echo "Comandos disponibles:"
@echo " windows - Compilar para Windows"
@echo " windows_debug - Compilar debug para Windows"
@echo " windows_release - Crear release completo para Windows"
@echo " linux - Compilar para Linux"
@echo " linux_debug - Compilar debug para Linux"
@echo " linux_release - Crear release completo para Linux"
@echo " macos - Compilar para macOS"
@echo " macos_debug - Compilar debug para macOS"
@echo " macos_release - Crear release completo para macOS"
@echo " pack_tool - Compilar herramienta de empaquetado"
@echo " resources.pack - Generar pack de recursos desde data/"
@echo " show_version - Mostrar version actual ($(VERSION))"
@echo " help - Mostrar esta ayuda"
FORCE:
.PHONY: windows windows_debug windows_release macos macos_debug macos_release linux linux_debug linux_release pack_tool resources.pack show_version help

106
README.md
View File

@@ -1,85 +1,75 @@
<div align="center">
<img src="https://php.sustancia.synology.me/images/jdd/jaildoctors_dilemma_cover_web.png" width="600" alt="JailDoctor's Dilemma Cover">
</div>
# JailDoctor's Dilemma
JailDoc es un Jailer. A los Jailers les gusta empezar proyectos. A nadie le gusta terminarlos. Los Jailers viven en la Jail. A la Jail va uno a empezar proyectos. A la Jail va uno a enseñar sus proyectos. A la Jail va uno a aprender como empezar nuevos proyectos. A la Jail va uno a ayudar a sus compañeros a que empiecen nuevos proyectos.
JailDoc és un Jailer. Als Jailers els agrada començar projectes. A ningú li agrada acabar-los. Els Jailers viuen a la Jail. A la Jail s'hi va a començar projectes. A la Jail s'hi va a ensenyar els projectes. A la Jail s'hi va a aprendre com començar nous projectes. A la Jail s'hi va a ajudar els companys a començar nous projectes.
JailDoc és un Jailer destacat entre els Jailers. Té més projectes començats que ningú i és qui més ajuda als altres a iniciar els seus.
![JailDoctor's Dilemma - Title screen](https://php.sustancia.synology.me/images/jdd_title.png)
Però un dia, va passar una cosa inesperada. Algú va acabar un projecte. Algú va alliberar el *Puzzle Jail Facker*. Un autèntic desaprensiu.
Això va fer que JailDoc prenguera una decisió: acabaria i lliuraria un dels seus projectes. Però, quin? *JailBattle*? *Sigmasuá*? *Calculín Doom*? Quin dilema! Finalment, es va arromangar i va decidir acabar i lliurar **tots** els seus projectes inacabats. Ho aconseguirà?
JailDoc es un Jailer destacado entre los Jailers. Tiene más proyectos empezados que nadie y es el que más ayuda a que los demas empiecen los suyos.
<br clear="left">
---
Un día, ocurrió algo. Alguien terminó un proyecto. Alguien liberó el *Puzzle Jail Facker*. Algún desaprensivo.
## Jugabilitat
Ajuda a JailDoc a recuperar les peces dels seus projectes, que estan escampades per qualsevol racó de l'Univers Jailer. Hi ha més de **150 peces** repartides en **60 pantalles**. Algunes són senzilles, però en altres hauràs de calcular molt bé els teus moviments si no vols acabar com un *arounder* més.
Esto hizo que JailDoc decidiera terminar y entregar uno de sus proyectos, pero, ¿cual? ¿JailBattle? ¿Sigmasuá? ¿Calculín Doom? Menudo dilema. JailDoc se arremangó y decidió finalizar y entregar todos sus proyectos inacabados. ¿Lo logrará?
![JailDoctor's Dilemma - Gameplay](https://php.sustancia.synology.me/images/jdd/jdd_game1.png)
Quan hages recuperat la major part de les peces, dirigeix-te a la Jail per mostrar als Jailers com es finalitza un projecte. Però compte! Bry no et deixarà entrar així com així. Només aquells que han creat un *Fire Effect* o un *Facedor de Tornejos* són dignes d'aquesta fita.
## Jugabilidad
---
Ayuda a JailDoc a recuperar las partes de su proyecto que estan desperdigadas por cualquier lugar del Universo Jailer. Hay mas de **150 piezas** desperdigadas por **60 pantallas**. Algunas son un paseo, pero en otras tendras que calcular muy bien tus movimientos si no quieres acabar como un arounder del montón.
## Controls
El joc permet tant l'ús del teclat com d'un comandament. Les tecles per a jugar són les següents:
![JailDoctor's Dilemma - Gameplay](https://php.sustancia.synology.me/images/jdd_game1.png)
| Tecla | Acció |
|-------|-------|
| **←, →** | Moure's a l'esquerra o dreta |
| **↑** | Saltar |
| **Enter** | Eixir dels projectes |
| **ESC** | Cancelar / Eixir del joc |
| **F1** | Disminuir la mida de la finestra |
| **F2** | Augmentar la mida de la finestra |
| **F3** | Alternar pantalla completa |
| **F4** | Activar/desactivar els shaders |
| **F5** | Següent paleta de colors |
| **F6** | Paleta de colors anterior |
| **F7** | Activar/desactivar l'escalat exacte |
| **F8** | Activar/desactivar la música |
| **F9** | Activar/desactivar el marge de colors |
| **F10** | Activar/desactivar VSync |
| **F11** | Pausar el joc |
**Nota:** Les tecles de moviment (←, →, ↑) es poden redefinir des del menú del joc.
Cuando consigas recuperar gran parte de las piezas desperdigadas, dirigete a la Jail a mostrar a los Jailers como se termina un proyecto. Ten en cuenta que Bry no te dejará entrar. Solo aquellos que han realizado un *Fire Effect* o un *Facedor de Tornejos* son dignos de tal privilegio.
![JailDoctor's Dilemma - Gameplay](https://php.sustancia.synology.me/images/jdd/jdd_game2.png)
---
## Controles
## Dades del programa
El juego permite tanto el uso del teclado como de un mando de control. Las teclas para manejar el juego son las siguientes:
El programa guarda automàticament la configuració del mode de vídeo i les estadístiques del joc a la teua carpeta personal del sistema. La ubicació d'aquesta carpeta depén del sistema operatiu que utilitzes:
- **Windows**: `C:\Users\<nom_d'usuari>\AppData\Roaming\jailgames\jaildoctors_dilemma`
- **MacOS**: `~/Library/Application Support/jailgames/jaildoctors_dilemma`
- **Linux**: `~/.config/jailgames/jaildoctors_dilemma`
- **Cursores**: Para mover a izquierda o derecha a JailDoc y para saltar
Dins de la carpeta es troba el fitxer de configuració `config.yaml`, on es pot modificar la configuració per connectar-se al servei en línia, i els fitxers `stats.csv` i `stats_buffer.csv`, que contenen informació sobre les estadístiques del joc.
- **Tecla M**: Activa o desactiva la música
---
- **Tecla P**: Pone en pausa el juego
## Agraïments
- **Tecla ESC**: Sale del juego si estas jugando. Sale del programa en cualquier otra circunstancia
Gràcies, com sempre, a tots els Jailers per motivar-me a crear aquest joc i per ajudar-me en els moments de dubte en escriure el codi. I, com sempre, un agraïment especial a JailDoc per la seua unitat de *Jail_Audio* i per qualsevol altre codi, ajuda o ensenyament que haja necessitat per a completar el programa.
- **Tecla F**: Cambia a modo de pantalla completa o de ventana
Si no he perdut el compte, aquest és el quart joc que aconseguisc crear.
- **Teclas F1 a F4**: Cambian el tamaño de la ventana
- **Tecla B**: Activa o desactiva el borde de colores de la pantalla cuando el programa se ejecuta en modo de ventana
![JailDoctor's Dilemma - Gameplay](https://php.sustancia.synology.me/images/jdd_game2.png)
## Datos del programa
El programa guarda automáticamente la configuración del modo de video y las estadísticas de juego en tu carpeta personal del sistema. Esta carpeta tiene una ubicación distinta en función del sistema operativo que utilices.
En **Windows** se encuentra en:
`C:\Users\<nombre_de_usuario>\AppData\Roaming\jaildoctors_dilemma`
En **MacOS** se encuentra en:
`~/Library/Application Support/jaildoctors_dilemma`
En **Linux** se encuentra en:
`~/.jaildoctors_dilemma`
En la carpeta está el fichero de configuración `config.txt` donde se puede modificar la configuración para conectarse al servicio online y los ficheros `stats.csv` y `stats_buffer.csv` con información de las estadisticas de juego.
## Agradecimientos
Agradecimientos como siempre a todos los Jailers por motivarme a hacer el juego y ayudarme en los momentos de duda a la hora de escribir el código. Y, como siempre, en especial a JailDoc por su unidad de Jail_Audio y cualquier otro código/ayuda/enseñanzas que haya necesitado para terminar el programa.
Si no me he descontado, este es el cuarto juego que consigo crear.
*13 de noviembre de 2022, JailDesigner*
*13 de novembre de 2022, JailDesigner*

592
config/assets.yaml Normal file
View File

@@ -0,0 +1,592 @@
# JailDoctor's Dilemma - Asset Configuration
# Variables: ${PREFIX}, ${SYSTEM_FOLDER}
assets:
# FONTS
fonts:
- type: BITMAP
path: ${PREFIX}/data/font/smb2.gif
- type: FONT
path: ${PREFIX}/data/font/smb2.txt
- type: BITMAP
path: ${PREFIX}/data/font/aseprite.gif
- type: FONT
path: ${PREFIX}/data/font/aseprite.txt
- type: BITMAP
path: ${PREFIX}/data/font/gauntlet.gif
- type: FONT
path: ${PREFIX}/data/font/gauntlet.txt
- type: BITMAP
path: ${PREFIX}/data/font/subatomic.gif
- type: FONT
path: ${PREFIX}/data/font/subatomic.txt
- type: BITMAP
path: ${PREFIX}/data/font/8bithud.gif
- type: FONT
path: ${PREFIX}/data/font/8bithud.txt
# PALETTES
palettes:
- type: PALETTE
path: ${PREFIX}/data/palette/zx-spectrum.pal
- type: PALETTE
path: ${PREFIX}/data/palette/zx-spectrum-adjusted.pal
- type: PALETTE
path: ${PREFIX}/data/palette/zxarne-5-2.pal
- type: PALETTE
path: ${PREFIX}/data/palette/black-and-white.pal
- type: PALETTE
path: ${PREFIX}/data/palette/green-phosphor.pal
- type: PALETTE
path: ${PREFIX}/data/palette/orange-screen.pal
- type: PALETTE
path: ${PREFIX}/data/palette/ruzx-spectrum.pal
- type: PALETTE
path: ${PREFIX}/data/palette/ruzx-spectrum-revision-2.pal
- type: PALETTE
path: ${PREFIX}/data/palette/pico-8.pal
- type: PALETTE
path: ${PREFIX}/data/palette/sweetie-16.pal
- type: PALETTE
path: ${PREFIX}/data/palette/island-joy-16.pal
- type: PALETTE
path: ${PREFIX}/data/palette/lost-century.pal
- type: PALETTE
path: ${PREFIX}/data/palette/na16.pal
- type: PALETTE
path: ${PREFIX}/data/palette/steam-lords.pal
# SHADERS
shaders:
- type: DATA
path: ${PREFIX}/data/shaders/crtpi_vertex.glsl
- type: DATA
path: ${PREFIX}/data/shaders/crtpi_fragment.glsl
- type: DATA
path: ${PREFIX}/data/shaders/crtpi_vertex_es.glsl
- type: DATA
path: ${PREFIX}/data/shaders/crtpi_fragment_es.glsl
# INPUT
input:
- type: DATA
path: ${PREFIX}/gamecontrollerdb.txt
# SYSTEM
system:
- type: DATA
path: ${SYSTEM_FOLDER}/config.yaml
required: false
absolute: true
- type: DATA
path: ${SYSTEM_FOLDER}/stats_buffer.csv
required: false
absolute: true
- type: DATA
path: ${SYSTEM_FOLDER}/stats.csv
required: false
absolute: true
- type: DATA
path: ${SYSTEM_FOLDER}/cheevos.bin
required: false
absolute: true
# ROOMS
rooms:
- type: ROOM
path: ${PREFIX}/data/room/01.yaml
- type: ROOM
path: ${PREFIX}/data/room/02.yaml
- type: ROOM
path: ${PREFIX}/data/room/03.yaml
- type: ROOM
path: ${PREFIX}/data/room/04.yaml
- type: ROOM
path: ${PREFIX}/data/room/05.yaml
- type: ROOM
path: ${PREFIX}/data/room/06.yaml
- type: ROOM
path: ${PREFIX}/data/room/07.yaml
- type: ROOM
path: ${PREFIX}/data/room/08.yaml
- type: ROOM
path: ${PREFIX}/data/room/09.yaml
- type: ROOM
path: ${PREFIX}/data/room/10.yaml
- type: ROOM
path: ${PREFIX}/data/room/11.yaml
- type: ROOM
path: ${PREFIX}/data/room/12.yaml
- type: ROOM
path: ${PREFIX}/data/room/13.yaml
- type: ROOM
path: ${PREFIX}/data/room/14.yaml
- type: ROOM
path: ${PREFIX}/data/room/15.yaml
- type: ROOM
path: ${PREFIX}/data/room/16.yaml
- type: ROOM
path: ${PREFIX}/data/room/17.yaml
- type: ROOM
path: ${PREFIX}/data/room/18.yaml
- type: ROOM
path: ${PREFIX}/data/room/19.yaml
- type: ROOM
path: ${PREFIX}/data/room/20.yaml
- type: ROOM
path: ${PREFIX}/data/room/21.yaml
- type: ROOM
path: ${PREFIX}/data/room/22.yaml
- type: ROOM
path: ${PREFIX}/data/room/23.yaml
- type: ROOM
path: ${PREFIX}/data/room/24.yaml
- type: ROOM
path: ${PREFIX}/data/room/25.yaml
- type: ROOM
path: ${PREFIX}/data/room/26.yaml
- type: ROOM
path: ${PREFIX}/data/room/27.yaml
- type: ROOM
path: ${PREFIX}/data/room/28.yaml
- type: ROOM
path: ${PREFIX}/data/room/29.yaml
- type: ROOM
path: ${PREFIX}/data/room/30.yaml
- type: ROOM
path: ${PREFIX}/data/room/31.yaml
- type: ROOM
path: ${PREFIX}/data/room/32.yaml
- type: ROOM
path: ${PREFIX}/data/room/33.yaml
- type: ROOM
path: ${PREFIX}/data/room/34.yaml
- type: ROOM
path: ${PREFIX}/data/room/35.yaml
- type: ROOM
path: ${PREFIX}/data/room/36.yaml
- type: ROOM
path: ${PREFIX}/data/room/37.yaml
- type: ROOM
path: ${PREFIX}/data/room/38.yaml
- type: ROOM
path: ${PREFIX}/data/room/39.yaml
- type: ROOM
path: ${PREFIX}/data/room/40.yaml
- type: ROOM
path: ${PREFIX}/data/room/41.yaml
- type: ROOM
path: ${PREFIX}/data/room/42.yaml
- type: ROOM
path: ${PREFIX}/data/room/43.yaml
- type: ROOM
path: ${PREFIX}/data/room/44.yaml
- type: ROOM
path: ${PREFIX}/data/room/45.yaml
- type: ROOM
path: ${PREFIX}/data/room/46.yaml
- type: ROOM
path: ${PREFIX}/data/room/47.yaml
- type: ROOM
path: ${PREFIX}/data/room/48.yaml
- type: ROOM
path: ${PREFIX}/data/room/49.yaml
- type: ROOM
path: ${PREFIX}/data/room/50.yaml
- type: ROOM
path: ${PREFIX}/data/room/51.yaml
- type: ROOM
path: ${PREFIX}/data/room/52.yaml
- type: ROOM
path: ${PREFIX}/data/room/53.yaml
- type: ROOM
path: ${PREFIX}/data/room/54.yaml
- type: ROOM
path: ${PREFIX}/data/room/55.yaml
- type: ROOM
path: ${PREFIX}/data/room/56.yaml
- type: ROOM
path: ${PREFIX}/data/room/57.yaml
- type: ROOM
path: ${PREFIX}/data/room/58.yaml
- type: ROOM
path: ${PREFIX}/data/room/59.yaml
- type: ROOM
path: ${PREFIX}/data/room/60.yaml
# TILESETS
tilesets:
- type: BITMAP
path: ${PREFIX}/data/tilesets/standard.gif
# ENEMIES
enemies:
- type: ANIMATION
path: ${PREFIX}/data/enemies/abad_bell.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/abad_bell.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/abad.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/abad.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/amstrad_cs.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/amstrad_cs.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/flying_arounder.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/flying_arounder.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/stopped_arounder.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/stopped_arounder.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/walking_arounder.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/walking_arounder.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/arounders_door.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/arounders_door.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/arounders_machine.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/arounders_machine.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/bat.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/bat.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/batman_bell.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/batman_bell.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/batman_fire.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/batman_fire.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/batman.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/batman.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/bell.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/bell.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/bin.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/bin.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/bird.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/bird.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/breakout.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/breakout.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/bry.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/bry.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/chip.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/chip.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/code.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/code.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/congo.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/congo.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/crosshair.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/crosshair.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/demon.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/demon.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/dimallas.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/dimallas.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/floppy.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/floppy.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/dong.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/dong.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/guitar.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/guitar.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/heavy.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/heavy.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/jailer1.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/jailer1.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/jailer2.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/jailer2.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/jailer3.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/jailer3.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/jailbattle_alien.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/jailbattle_alien.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/jailbattle_human.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/jailbattle_human.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/jeannine.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/jeannine.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/lamp.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/lamp.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/lord_abad.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/lord_abad.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/matatunos.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/matatunos.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/mummy.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/mummy.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/paco.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/paco.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/elsa.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/elsa.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/qvoid.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/qvoid.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/robot.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/robot.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/sam.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/sam.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/shock.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/shock.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/sigmasua.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/sigmasua.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/spark.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/spark.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/special/aerojailer.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/special/aerojailer.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/special/arounder.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/special/arounder.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/special/pepe_rosita_job.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/special/pepe_rosita_job.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/special/shooting_star.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/special/shooting_star.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/spider.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/spider.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/tree_thing.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/tree_thing.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/tuno.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/tuno.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/tv_panel.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/tv_panel.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/tv.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/tv.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/upv_student.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/upv_student.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/wave.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/wave.gif
- type: ANIMATION
path: ${PREFIX}/data/enemies/z80.yaml
- type: BITMAP
path: ${PREFIX}/data/enemies/z80.gif
# PLAYER
player:
- type: BITMAP
path: ${PREFIX}/data/player/player.gif
- type: ANIMATION
path: ${PREFIX}/data/player/player.yaml
- type: BITMAP
path: ${PREFIX}/data/player/player2.gif
- type: ANIMATION
path: ${PREFIX}/data/player/player2.yaml
- type: BITMAP
path: ${PREFIX}/data/player/player_game_over.gif
- type: ANIMATION
path: ${PREFIX}/data/player/player_game_over.yaml
# ITEMS
items:
- type: BITMAP
path: ${PREFIX}/data/items/items.gif
# MUSIC
music:
- type: MUSIC
path: ${PREFIX}/data/music/title.ogg
- type: MUSIC
path: ${PREFIX}/data/music/game.ogg
- type: MUSIC
path: ${PREFIX}/data/music/loading_data1.ogg
- type: MUSIC
path: ${PREFIX}/data/music/loading_data2.ogg
- type: MUSIC
path: ${PREFIX}/data/music/loading_header.ogg
- type: MUSIC
path: ${PREFIX}/data/music/loading_screen_color.ogg
- type: MUSIC
path: ${PREFIX}/data/music/loading_screen_data.ogg
- type: MUSIC
path: ${PREFIX}/data/music/ending1.ogg
- type: MUSIC
path: ${PREFIX}/data/music/ending2.ogg
- type: MUSIC
path: ${PREFIX}/data/music/game_over.ogg
# SOUNDS
sounds:
- type: SOUND
path: ${PREFIX}/data/sound/item.wav
- type: SOUND
path: ${PREFIX}/data/sound/death.wav
- type: SOUND
path: ${PREFIX}/data/sound/notify.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump1.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump2.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump3.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump4.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump5.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump6.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump7.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump8.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump9.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump10.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump11.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump12.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump13.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump14.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump15.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump16.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump17.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump18.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump19.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump20.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump21.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump22.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump23.wav
- type: SOUND
path: ${PREFIX}/data/sound/jump24.wav
# LOGO
logo:
- type: BITMAP
path: ${PREFIX}/data/logo/jailgames.gif
- type: BITMAP
path: ${PREFIX}/data/logo/since_1998.gif
# LOADING
loading:
- type: BITMAP
path: ${PREFIX}/data/loading/loading_screen_bn.gif
- type: BITMAP
path: ${PREFIX}/data/loading/loading_screen_color.gif
- type: BITMAP
path: ${PREFIX}/data/loading/program_jaildoc.gif
# TITLE
title:
- type: BITMAP
path: ${PREFIX}/data/title/title_logo.gif
# ENDING
ending:
- type: BITMAP
path: ${PREFIX}/data/ending/ending1.gif
- type: BITMAP
path: ${PREFIX}/data/ending/ending2.gif
- type: BITMAP
path: ${PREFIX}/data/ending/ending3.gif
- type: BITMAP
path: ${PREFIX}/data/ending/ending4.gif
- type: BITMAP
path: ${PREFIX}/data/ending/ending5.gif
# CREDITS
credits:
- type: BITMAP
path: ${PREFIX}/data/credits/shine.gif
- type: ANIMATION
path: ${PREFIX}/data/credits/shine.yaml

View File

@@ -1,9 +0,0 @@
frameWidth=8
frameHeight=8
[animation]
name=default
speed=6
loop=-1
frames=0,1,2,3,4,5,6,7
[/animation]

BIN
data/credits/shine.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 B

10
data/credits/shine.yaml Normal file
View File

@@ -0,0 +1,10 @@
# shine animation
tileSetFile: shine.gif
frameWidth: 8
frameHeight: 8
animations:
- name: default
speed: 0.1
loop: -1
frames: [0, 1, 2, 3, 4, 5, 6, 7]

BIN
data/ending/ending1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

BIN
data/ending/ending2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

BIN
data/ending/ending3.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

BIN
data/ending/ending4.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
data/ending/ending5.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -1,9 +0,0 @@
frameWidth=8
frameHeight=16
[animation]
name=default
speed=8
loop=0
frames=0,1,2
[/animation]

BIN
data/enemies/abad.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 B

10
data/enemies/abad.yaml Normal file
View File

@@ -0,0 +1,10 @@
# abad animation
tileSetFile: abad.gif
frameWidth: 8
frameHeight: 16
animations:
- name: default
speed: 0.1333
loop: 0
frames: [0, 1, 2]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=4
loop=0
frames=0,1,2,3,4,5,6,7,8,9
[/animation]

BIN
data/enemies/abad_bell.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 555 B

View File

@@ -0,0 +1,10 @@
# abad_bell animation
tileSetFile: abad_bell.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.0667
loop: 0
frames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

View File

@@ -1,9 +0,0 @@
frameWidth=8
frameHeight=8
[animation]
name=default
speed=4
loop=0
frames=0,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,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
[/animation]

BIN
data/enemies/amstrad_cs.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

View File

@@ -0,0 +1,10 @@
# amstrad_cs animation
tileSetFile: amstrad_cs.gif
frameWidth: 8
frameHeight: 8
animations:
- name: default
speed: 0.0667
loop: 0
frames: [0, 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, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255]

View File

@@ -1,9 +0,0 @@
frameWidth=7
frameHeight=7
[animation]
name=default
speed=10
loop=0
frames=0
[/animation]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

View File

@@ -1,9 +0,0 @@
frameWidth=7
frameHeight=8
[animation]
name=default
speed=10
loop=0
frames=0,1,2,3
[/animation]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

View File

@@ -1,9 +0,0 @@
frameWidth=5
frameHeight=8
[animation]
name=default
speed=6
loop=0
frames=0,1
[/animation]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=8
loop=0
frames=0,1,2,3,3,3,3,3,3,3,3,3,3,3,3,2,1,0,0,0
[/animation]

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

View File

@@ -0,0 +1,10 @@
# arounders_door animation
tileSetFile: arounders_door.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.1333
loop: 0
frames: [0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 1, 0, 0, 0]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=4
loop=0
frames=0,1,2,3
[/animation]

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

View File

@@ -0,0 +1,10 @@
# arounders_machine animation
tileSetFile: arounders_machine.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.0667
loop: 0
frames: [0, 1, 2, 3]

View File

@@ -1,9 +0,0 @@
frameWidth=9
frameHeight=7
[animation]
name=default
speed=3
loop=0
frames=0,1
[/animation]

BIN
data/enemies/bat.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

10
data/enemies/bat.yaml Normal file
View File

@@ -0,0 +1,10 @@
# bat animation
tileSetFile: bat.gif
frameWidth: 9
frameHeight: 7
animations:
- name: default
speed: 0.05
loop: 0
frames: [0, 1]

View File

@@ -1,9 +0,0 @@
frameWidth=8
frameHeight=16
[animation]
name=default
speed=8
loop=0
frames=0,1,2,3
[/animation]

BIN
data/enemies/batman.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

10
data/enemies/batman.yaml Normal file
View File

@@ -0,0 +1,10 @@
# batman animation
tileSetFile: batman.gif
frameWidth: 8
frameHeight: 16
animations:
- name: default
speed: 0.1333
loop: 0
frames: [0, 1, 2, 3]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=6
loop=0
frames=0,1,2,3,4,5
[/animation]

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 B

View File

@@ -0,0 +1,10 @@
# batman_bell animation
tileSetFile: batman_bell.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.1
loop: 0
frames: [0, 1, 2, 3, 4, 5]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=4
loop=0
frames=0,1,2,3
[/animation]

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

View File

@@ -0,0 +1,10 @@
# batman_fire animation
tileSetFile: batman_fire.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.0667
loop: 0
frames: [0, 1, 2, 3]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=6
loop=0
frames=0,1,2,3,4,5,6,7,8,9,10,11
[/animation]

BIN
data/enemies/bell.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 509 B

10
data/enemies/bell.yaml Normal file
View File

@@ -0,0 +1,10 @@
# bell animation
tileSetFile: bell.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.1
loop: 0
frames: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=8
[animation]
name=default
speed=10
loop=0
frames=0,1,2,3,4
[/animation]

BIN
data/enemies/bin.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

10
data/enemies/bin.yaml Normal file
View File

@@ -0,0 +1,10 @@
# bin animation
tileSetFile: bin.gif
frameWidth: 16
frameHeight: 8
animations:
- name: default
speed: 0.1667
loop: 0
frames: [0, 1, 2, 3, 4]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=8
loop=0
frames=0,1,2,3
[/animation]

BIN
data/enemies/bird.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

10
data/enemies/bird.yaml Normal file
View File

@@ -0,0 +1,10 @@
# bird animation
tileSetFile: bird.gif
frameWidth: 16
frameHeight: 16
animations:
- name: default
speed: 0.1333
loop: 0
frames: [0, 1, 2, 3]

View File

@@ -1,9 +0,0 @@
frameWidth=24
frameHeight=32
[animation]
name=default
speed=6
loop=0
frames=0,1,2,3,4,5,6,7,6,5,4,3,2,1
[/animation]

BIN
data/enemies/breakout.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

View File

@@ -0,0 +1,10 @@
# breakout animation
tileSetFile: breakout.gif
frameWidth: 24
frameHeight: 32
animations:
- name: default
speed: 0.1
loop: 0
frames: [0, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1]

View File

@@ -1,9 +0,0 @@
frameWidth=10
frameHeight=16
[animation]
name=default
speed=6
loop=0
frames=0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3,4,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5,4,5
[/animation]

BIN
data/enemies/bry.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

10
data/enemies/bry.yaml Normal file
View File

@@ -0,0 +1,10 @@
# bry animation
tileSetFile: bry.gif
frameWidth: 10
frameHeight: 16
animations:
- name: default
speed: 0.1
loop: 0
frames: [0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5]

View File

@@ -1,9 +0,0 @@
frameWidth=8
frameHeight=16
[animation]
name=default
speed=8
loop=0
frames=0,1,2,3
[/animation]

BIN
data/enemies/chip.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

10
data/enemies/chip.yaml Normal file
View File

@@ -0,0 +1,10 @@
# chip animation
tileSetFile: chip.gif
frameWidth: 8
frameHeight: 16
animations:
- name: default
speed: 0.1333
loop: 0
frames: [0, 1, 2, 3]

View File

@@ -1,9 +0,0 @@
frameWidth=16
frameHeight=16
[animation]
name=default
speed=6
loop=0
frames=0,1,2,3
[/animation]

BIN
data/enemies/code.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

Some files were not shown because too many files have changed in this diff Show More