Menu de inicio, nuevo nivel y ajustes en objetos

This commit is contained in:
Diego De la Viuda Llorente committed 2026-10-29 16:39:46 +01:00
1 parent cd9f31c8c1
commit 827e16cf50
61 files changed
+2685 -3553

No files matched your search

+75 -63
View File
@@ -1,78 +1,90 @@
# Pixel combat pass
# Combate y animaciones pixel
Apply this patch after `fix_player.patch` and `fix_level_02.patch`.
It does not reapply or undo either fix.
Descripción del código integrado, revisada el 29 de octubre de 2026. No es una
instrucción para volver a aplicar parches antiguos. El HUD y la carga actuales
se detallan en [HUD thrash](thrash_hud.md); las tareas están en
[Guía maestra](design_vision.md).
## Art and scale
## Arte y escala
The four existing CharacterData resources still share the same SpriteFrames.
Their existing references and the SpriteFrames UID are retained. The old PNGs
are not deleted; the new resource uses `assets/characters/ankarde/player_pixel.svg`.
This is a self-contained pixel atlas (integer coordinates, flat palette), matching
the SVG pixel style of the enemies. No external fonts, plugins or image files are
needed to build the atlas.
Los cuatro `CharacterData` comparten `prototype_sprite_frames.tres`, que utiliza
`assets/characters/ankarde/player_pixel.svg`. El atlas contiene 37 celdas de
64 x 64 y once animaciones: idle, walk, jump, fall, punch, ground_pound, land,
special_start, special, special_end y hurt. No hay aún un juego de animaciones
por integrante; los PNG antiguos no se han eliminado.
There are 37 frames in 11 animations: idle, walk, jump, fall, punch, ground pound,
land, special start, special loop, special end and hurt. Cells are 64 x 64 pixels,
with the standing character approximately 56 pixels tall. Nearest filtering and
1:1 sprite scale avoid smoothing. The body and hurtbox change from 41 x 74 to
26 x 52, comparable to the enemies' 28 x 52 bodies. Jump and movement stats are
unchanged. The punch area and ground-pound origin follow the new proportions.
El personaje de pie mide aproximadamente 56 px de alto en el atlas. El sprite
usa filtrado nearest y escala 1:1. Su cuerpo/hurtbox es de 26 x 52; los enemigos
usan 28 x 52. Estos valores son de recursos, no una certificación visual en
pantalla. El código admite animaciones provisionales y conserva un único Player.
## Combat behaviour
## Comportamiento implementado
- Punch: 0.28-second animation, 0.055-second windup and 0.11-second active window.
A target takes one hit per punch. The 0.34-second cooldown is enforced.
- Ground pound: dedicated falling pose, squash on landing, ground-space dust,
cracks and an expanding impact ring. Damage remains capped at 7-12. The impact
queries the hurtboxes at the resolved landing position rather than the previous
physics frame's cached Area2D overlaps.
- Special: 2.4 seconds by default, with four pulses at 0.36, 0.88, 1.40 and 1.92
seconds. The player draws a guitar, plays the solo and lowers it afterwards.
Movement, jump and other attacks are locked during the solo, except for recoil
and incoming knockback. No extra invulnerability is granted.
- All current charge is consumed once, on activation. Kills during the solo can
recharge the next attack; recasting during the current solo is blocked.
- The original damage budget is distributed across the pulses, NOT applied four
times. Cumulative rounding avoids losing points or imposing one point per pulse
on a tiny budget. The per-target budget is fixed on first contact. Enemies must
still be on screen and within special_radius to receive each pulse, so escaping
its range can avoid later damage. The existing per-level radius is preserved.
- Enemies flash on impact and retain knockback. At zero HP, logical death and the
existing rewards happen immediately once. Combat collisions stop, while the
body launches, falls against the world, collapses and fades for 0.9 seconds.
Dead nodes remain available to the levels' KO polling and total-enemy counts.
Respawn still works and restores the sprite transform, opacity and collisions.
**Puñetazo.** Dura 0,28 s, con 0,055 s de preparación y 0,11 s de ventana
activa. El registro de objetivos impide repetir un impacto del mismo ataque.
El cooldown es de 0,34 s. El daño base actual es 5, antes de mejoras.
Effects are independent of the debug-hitbox flags. They use lightweight transient
world-space nodes and a non-interactive screen overlay below the HUD. Effects
clean themselves up. No new music or guitar audio is included in this visual pass.
**Ground Pound.** Solo comienza en el aire; al aterrizar consulta hurtboxes en
la posición física resuelta. Usa pose de caída, polvo, grietas y un anillo
de impacto. La fórmula mide altura ganada desde el despegue, no toda la caída
desde una cornisa. Aplica 7–12 de daño y limita también a 12 tras las
mejoras. El campo `CharacterData.air_attack_damage` no participa.
## Adjustments in the Inspector
**Especial.** Por defecto dura 2,4 s, con cuatro pulsos previstos a los 0,36,
0,88, 1,40 y 1,92 s. Durante el solo se bloquean movimiento voluntario, salto y
otros ataques; sigue existiendo retroceso y se puede recibir daño. No concede
invulnerabilidad adicional.
- Player: special_duration, special_pulse_count and existing special_radius.
- Camera2D: feedback_strength from 0 to 1. Zero disables both screen overlays and
camera shake. Shake is capped at three world pixels; there are no white flashes.
- Enemy: death_animation_duration. Respawn delay remains measured from logical death.
La regla vigente es capacidad 100, +10 por baja normal y mínimo de activación
25. Consume toda la carga acumulada una sola vez. `special_kills_grant_charge`
está desactivado: las bajas causadas por el propio solo no recargan por defecto.
Una baja normal coincidente con la animación sí puede conceder carga. No se
puede volver a lanzar otro solo mientras el actual siga activo.
## Checks
El especial fija un presupuesto de daño por objetivo al primer contacto,
según carga y distancia. Lo reparte por pulsos con redondeo acumulado, **no lo
aplica cuatro veces completo**. Cada pulso exige que el enemigo siga en pantalla
y dentro del radio; salir puede evitar daño posterior. Level00/Level01 usan
radio 290; el valor general sigue siendo 100000 y la plantilla lo hereda. La
atenuación depende del viewport, por lo que hay que comparar pantallas y zoom.
Engine-independent resource checks:
**Enemigos.** Al recibir daño muestran flash, retroceso y aturdimiento según
el perfil. Al llegar a cero emiten la muerte lógica una sola vez y resuelven
la recompensa. Se desactivan las colisiones ofensivas/vulnerables, pero el
cuerpo conserva el suelo durante la animación de caída y desaparición.
La duración visual por defecto es 0,9 s.
```sh
python -m unittest discover -s tests -v
Los nodos muertos se conservan para diagnóstico y recuentos de nivel. El Walker
base admite respawn; las cinco variantes lo desactivan. La reaparición restaura
posición, vida, transformaciones visuales, opacidad y colisiones.
## Efectos y ajustes
`effects/combat_fx.gd` crea efectos visuales temporales; no decide daño.
`player/camera_2d.gd` controla sacudidas y superposiciones, no el alcance de los
ataques. Los efectos no dependen del dibujo de hitboxes de depuración.
En Player se ajustan `special_duration`, `special_pulse_count`, `special_radius`
y los grupos de cada ataque. En Camera2D, `feedback_strength = 0` desactiva
sacudidas y superposiciones. En Walker, `death_animation_duration` ajusta la
animación; el tiempo de respawn se mide desde la muerte lógica.
**No hay audio integrado para el solo ni para estos efectos.** Su presentación
es visual. La guía maestra mantiene el audio como tarea separada.
## Comprobaciones
```bash
python tools/run_checks.py --static-only
python tools/run_checks.py --godot /ruta/al/ejecutable/godot
```
Import the new SVG and register scripts, then run engine integration checks:
El runner importa antes de ejecutar las suites del motor. Las pruebas de combate
incluidas comprueban recursos, consumo, reparto de pulsos, límite del golpe
aéreo, muerte y respawn; la suite del HUD comprueba la economía del solo.
**No se han ejecutado en Godot en esta revisión.** Los 58 tests estáticos
superados no sustituyen estas suites ni una partida.
```sh
godot --headless --path . --editor --import
godot --headless --path . --script res://tests/test_level_02_runtime.gd
godot --headless --path . --script res://tests/test_pixel_combat_runtime.gd
```
The combat check exercises scene/texture loading, charge consumption, delayed and
bounded pulse damage, recoil, death visibility, one-time rewards, respawn state
and the 12-point ground-pound cap. This headless check is not a visual playtest.
In the editor, run Level02 and check W (jump), J (punch), K (air ground pound) and
L (charged guitar solo), including left-facing attacks and mobile controls.
La prueba interactiva debe cubrir W/J/K/L, ataques hacia ambos lados, grupos,
carga 20/30/100, enemigos que salen del alcance, buffs y controles táctiles.
Comprobar legibilidad y balance por separado del resultado de las aserciones.