Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4b99000c0a | ||
|
|
735192bc01 | ||
|
|
9c6f61cf37 | ||
|
|
4850d79149 | ||
|
|
98c52d9120 | ||
|
|
f1363dd6c8 | ||
|
|
3b7014ef0e | ||
|
|
aeb5b324f1 | ||
|
|
f9d23ec631 | ||
|
|
e1e29f02f1 | ||
|
|
f58bae85ea | ||
|
|
5012879591 | ||
|
|
a77829fa06 | ||
|
|
1e70a99224 | ||
|
|
c4773c94e7 | ||
|
|
8fc8925151 | ||
|
|
45ee99b054 | ||
|
|
1fbfdf3f8a | ||
|
|
ec1f211956 | ||
|
|
5c3d16951e | ||
|
|
27f8b4b70e | ||
|
|
82c7963767 | ||
|
|
4c4d52ef3d | ||
|
|
84c148f1ab | ||
|
|
fe0a134b8a | ||
|
|
8bbf70e8cb | ||
|
|
f8f83e822e | ||
|
|
bbecc76dbe | ||
|
|
511e317978 | ||
|
|
0ff8df6a6b | ||
|
|
647d88989d | ||
|
|
00804de7d9 | ||
|
|
617f2d4dce | ||
|
|
eee0f98ab0 | ||
|
|
1611a98e40 | ||
|
|
79a7621a42 | ||
|
|
3e6b09c7de | ||
|
|
6d0948022a | ||
|
|
d9eacb104c | ||
|
|
eaa6c4e8d3 | ||
|
|
b002952d97 | ||
|
|
1b3991e2ad | ||
|
|
7264f75d6a | ||
|
|
e8c1f5d166 | ||
|
|
767c9c6c91 | ||
|
|
623517c5fb | ||
|
|
f33ab4e183 | ||
|
|
80d550b6fa | ||
|
|
37206548e1 | ||
|
|
93497002ff | ||
|
|
18b0ca30c2 | ||
|
|
ba4db3b47e | ||
|
|
70ac0c8f3d | ||
|
|
b66bef09cb | ||
|
|
cf42886682 | ||
|
|
abb3e5afa0 | ||
|
|
18b0fae498 | ||
|
|
385be4e84d | ||
|
|
9b32d97d1f | ||
|
|
5d87de8ca1 | ||
|
|
f5cc3b65b2 |
No files matched your search
@@ -4,3 +4,7 @@
|
||||
|
||||
# Local export artifacts
|
||||
build/
|
||||
|
||||
# Python-only static checks for the level resources
|
||||
__pycache__/
|
||||
*.pyc
|
||||
@@ -1882,10 +1882,17 @@ Actualizar esta sección conforme avance el proyecto.
|
||||
- Vida, daño, knockback, invulnerabilidad breve y muerte/reinicio del jugador.
|
||||
- CharacterData con cuatro recursos: singer, guitarist, bassist y drummer.
|
||||
- Los cuatro personajes usan provisionalmente las mismas animaciones idle/walk de Diego.
|
||||
- Primer enemigo Walker: patrulla, gira en paredes/bordes, hace daño por contacto,
|
||||
recibe daño y muere.
|
||||
- Walker: persigue y ataca con animacion temporal de aviso, recibe dano y muere.
|
||||
- Cinco apariencias humanoides del enemigo (roadie, fan del pogo, tecnico,
|
||||
guardia y guitarrista rival) con SVG originales y estadisticas propias.
|
||||
- Level 01 ampliado a 8500 unidades, 17 encuentros de recompensa fija sin
|
||||
respawn y varias plataformas opcionales para probar la movilidad.
|
||||
- Level 02: alfa urbana de 11.000 unidades, 29 enemigos, 14 pickups colocados,
|
||||
11 plataformas, ocho tramos de calle y cuatro capas de parallax.
|
||||
- Hurtboxes y zonas de ataque visibles en modo debug con rojo semitransparente.
|
||||
- Sala levels/test/combat_test.tscn para probar el combate.
|
||||
- Objetos recolectables configurables, curacion y siete buffs/cargas distintos.
|
||||
- HUD de mejoras activas y contador de objetos realmente recogidos en Level 01.
|
||||
- Controles táctiles provisionales para Android usando las mismas acciones del InputMap.
|
||||
- Preset Android preparado para generar un APK arm64 de pruebas.
|
||||
- Script scripts/export_android_debug.sh para exportar el APK desde un servidor sin GUI.
|
||||
@@ -1897,7 +1904,9 @@ Actualizar esta sección conforme avance el proyecto.
|
||||
- Probar y ajustar tamaños/offsets de hurtboxes e hitboxes jugando la sala de combate.
|
||||
- Sustituir las animaciones provisionales cuando exista arte para cada integrante.
|
||||
- Probar tamaños y colocación de los controles táctiles en varios teléfonos.
|
||||
- Añadir UI provisional de vida si hace falta para seguir afinando el combate.
|
||||
- Validar las rutas de Level 01 (laboratorio) y Level 02 (campo) en Android,
|
||||
con plataformas, drops y rendimiento gráfico.
|
||||
- Ajustar posicion/tamano de los HUDs y controles para distintas pantallas.
|
||||
```
|
||||
|
||||
## LATER
|
||||
@@ -1905,7 +1914,7 @@ Actualizar esta sección conforme avance el proyecto.
|
||||
```text
|
||||
- diferencias particulares entre personajes;
|
||||
- invisibilidad del bajista;
|
||||
- power-ups adicionales;
|
||||
- coleccionables secretos;
|
||||
- definición completa de capítulos;
|
||||
- bosses;
|
||||
- easter eggs;
|
||||
@@ -1944,3 +1953,95 @@ LATER
|
||||
```
|
||||
|
||||
El objetivo principal es siempre tener una versión pequeña pero completamente jugable antes de ampliar el alcance.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Estado actualizado: objetos y recompensas (octubre de 2026)
|
||||
|
||||
- **Implementado:** 17 objetos configurables (`pickups/data/`) con SVG originales de 32×32 (16×16 visibles), textos breves y efectos.
|
||||
- **Implementado:** curación, velocidad, daño, carga del especial, bloqueo de un golpe, reducción de daño, altura de salto y daño aéreo.
|
||||
- **Implementado:** tabla de drops ponderados de Walker; 50% de probabilidad de un objeto por muerte.
|
||||
- **Implementado:** `level_01.tscn` es ahora un laboratorio de objetos con 17 enemigos,
|
||||
17 drops garantizados diferentes, ninguno reaparece, y 5 variantes visuales
|
||||
originales con un unico comportamiento Walker.
|
||||
- **Implementado:** indicador de mejoras activas con duracion/escudo, contador
|
||||
de objetos recogidos y limites de camara adaptados al nivel largo.
|
||||
- **Implementado:** especial con radio configurable (290 en el laboratorio),
|
||||
sin modificar el alcance por defecto en el resto de escenas.
|
||||
- **Pendiente:** coleccionables secretos, test visual en Godot/Android,
|
||||
equilibrio y sprites/animaciones definitivas.
|
||||
|
||||
Catálogo, pesos, estados e instrucciones: **[docs/items.md](docs/items.md)**.
|
||||
|
||||
Recorrido de Android (17 estaciones, orden y checklist):
|
||||
**[docs/test_level_01.md](docs/test_level_01.md)**.
|
||||
|
||||
**Diagnostico de objetos (LAB DROPS v4):** el nivel muestra en su HUD la
|
||||
version activa, KOs observados, senales recibidas, drops creados y objetos
|
||||
presentes en el suelo. Incluye un pickup de control al principio que no
|
||||
depende de matar enemigos y no cuenta para los 17 objetos. El nivel de pruebas
|
||||
crea las recompensas fijas al observar `is_dead`, una unica vez por enemigo;
|
||||
los drops aleatorios fuera de este nivel no cambian. Esta correccion necesita
|
||||
validacion real en Godot/Android: las comprobaciones estaticas no sustituyen
|
||||
una partida.
|
||||
|
||||
|
||||
Comprobacion estatica reproducible (sin arrancar Godot):
|
||||
`python -m unittest discover -s tests -v`.
|
||||
|
||||
Prueba de drops dentro del motor (necesita Godot instalado):
|
||||
`godot --headless --path . --script res://tests/test_pickup_runtime.gd`.
|
||||
Esta comprobacion fuerza 17 muertes, desconecta una senal de forma
|
||||
intencionada y verifica el contador de KOs, los 17 drops, el pickup de
|
||||
control y que no se dupliquen recursos,
|
||||
iconos y presencia en escena. Los pickups se generan fuera de la fase de
|
||||
colisiones; los que sueltan enemigos tienen una espera de 0,75 segundos,
|
||||
mientras que los ya colocados en el escenario se recogen inmediatamente.
|
||||
Todos los `PickupData` usan colores numericos `Color(r, g, b, a)` validos
|
||||
para el formato `.tres`.
|
||||
|
||||
**Recogida con movimiento y buffs de velocidad (octubre 2026):** el area del
|
||||
pickup vuelve a comprobar solapamientos cada paso de fisica, y recuerda los
|
||||
contactos ocurridos durante los 0,75 s de espera de los drops. Ya no debe
|
||||
perderse un objeto por cruzarlo corriendo mientras aparece. El disparador
|
||||
aumenta a 28 x 24, pero el SVG sigue viendose a 16 x 16. Los items que no
|
||||
pueden aplicarse muestran `HP LLENO` o `ESPECIAL LLENO` en lugar de aparentar
|
||||
que no funcionan. El movimiento y el HUD usan `Player.get_move_speed()`; durante
|
||||
una mejora se muestran su porcentaje, velocidad efectiva (px/s) y tiempo.
|
||||
La prueba Godot `tests/test_pickup_runtime.gd` incluye estos escenarios; sigue
|
||||
pendiente la comprobacion en un telefono real.
|
||||
|
||||
La escena de inicio del proyecto es `levels/level_02.tscn`. El laboratorio
|
||||
`levels/level_01.tscn` sigue disponible y no se ha eliminado.
|
||||
Para exportar una APK de pruebas, revisa las instrucciones de
|
||||
`scripts/export_android_debug.sh` y el preset de Android (requiere SDK y
|
||||
plantillas Godot configuradas localmente).
|
||||
|
||||
> Importante: el proyecto contiene un prototipo jugable y arte provisional; la implementación no sustituye una prueba real en Godot ni garantiza una clasificación por edades concreta.
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Alfa urbana — Level 02 (octubre de 2026)
|
||||
|
||||
**Implementado en escena:** `levels/level_02.tscn` y `levels/level_02.gd`,
|
||||
con 11.000 unidades de recorrido, calles a ocho alturas, 11 plataformas
|
||||
(opcionales, varias encadenadas), 29 enemigos en encuentros individuales y
|
||||
grupos, 14 objetos repartidos y barreras al principio/final. Meta con resumen.
|
||||
|
||||
**Arte original:** 15 PNG pixel art en `assets/city/`, incluidas seis fachadas
|
||||
reutilizadas, textura de asfalto y cuatro capas `Parallax2D` (cielo, nubes,
|
||||
edificios lejanos e intermedios). Generador reproducible en
|
||||
`tools/generate_city_art.py`; Pillow solo se requiere para regenerar imágenes.
|
||||
|
||||
**Nuevo equilibrio compartido:** 50 HP para los cuatro integrantes, enemigos
|
||||
entre 11 y 21 HP y ground pound de 7–12 de daño, máximo 12 incluso con buffs.
|
||||
Los drops y el inventario de Level 01 se conservan.
|
||||
|
||||
**Pendiente:** comprobar el nivel real en Godot/Android, especialmente el
|
||||
renderizado parallax, los saltos en cadena y el balance con varios enemigos.
|
||||
Las comprobaciones Python de estructura pasan, pero no sustituyen una partida.
|
||||
|
||||
Guía del recorrido, arte, parámetros y checklist:
|
||||
**[docs/level_02.md](docs/level_02.md)**.
|
||||
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 446 B |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 201 B |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 673 B |
|
After Width: | Height: | Size: 176 B |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="56" viewBox="0 0 32 56" shape-rendering="crispEdges">
|
||||
<title>Guardia de camerino</title>
|
||||
<rect x="6" y="49" width="9" height="7" fill="#161723"/><rect x="18" y="49" width="9" height="7" fill="#161723"/><rect x="7" y="51" width="7" height="4" fill="#241f2d"/><rect x="19" y="51" width="7" height="4" fill="#241f2d"/><rect x="9" y="38" width="6" height="13" fill="#161723"/><rect x="18" y="38" width="6" height="13" fill="#161723"/><rect x="10" y="39" width="4" height="11" fill="#262634"/><rect x="19" y="39" width="4" height="11" fill="#262634"/><rect x="5" y="22" width="22" height="19" fill="#161723"/><rect x="7" y="23" width="18" height="16" fill="#2d3547"/><rect x="2" y="24" width="5" height="16" fill="#161723"/><rect x="25" y="24" width="5" height="16" fill="#161723"/><rect x="3" y="25" width="3" height="13" fill="#343f53"/><rect x="26" y="25" width="3" height="13" fill="#343f53"/><rect x="2" y="38" width="5" height="4" fill="#ecb78b"/><rect x="25" y="38" width="5" height="4" fill="#ecb78b"/><rect x="9" y="8" width="14" height="17" fill="#161723"/><rect x="11" y="10" width="10" height="14" fill="#ecb78b"/><rect x="13" y="18" width="6" height="2" fill="#a77765"/><rect x="10" y="6" width="12" height="4" fill="#161723"/><rect x="8" y="7" width="16" height="3" fill="#45424c"/><rect x="11" y="13" width="5" height="4" fill="#161723"/><rect x="17" y="13" width="5" height="4" fill="#161723"/><rect x="15" y="14" width="3" height="1" fill="#a9b7cf"/><rect x="13" y="20" width="6" height="2" fill="#161723"/><rect x="7" y="24" width="18" height="4" fill="#46536a"/><rect x="13" y="27" width="6" height="10" fill="#f6eecb"/><rect x="15" y="28" width="2" height="8" fill="#9c4254"/><rect x="7" y="38" width="18" height="3" fill="#161723"/><rect x="11" y="38" width="9" height="2" fill="#aeb5ce"/><rect x="25" y="30" width="5" height="4" fill="#1c2430"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="56" viewBox="0 0 32 56" shape-rendering="crispEdges">
|
||||
<title>Tecnico del feedback</title>
|
||||
<rect x="6" y="49" width="9" height="7" fill="#161723"/><rect x="18" y="49" width="9" height="7" fill="#161723"/><rect x="7" y="51" width="7" height="4" fill="#5a4241"/><rect x="19" y="51" width="7" height="4" fill="#5a4241"/><rect x="9" y="38" width="6" height="13" fill="#161723"/><rect x="18" y="38" width="6" height="13" fill="#161723"/><rect x="10" y="39" width="4" height="11" fill="#4b4654"/><rect x="19" y="39" width="4" height="11" fill="#4b4654"/><rect x="5" y="22" width="22" height="19" fill="#161723"/><rect x="7" y="23" width="18" height="16" fill="#547a63"/><rect x="2" y="24" width="5" height="16" fill="#161723"/><rect x="25" y="24" width="5" height="16" fill="#161723"/><rect x="3" y="25" width="3" height="13" fill="#d2bd53"/><rect x="26" y="25" width="3" height="13" fill="#d2bd53"/><rect x="2" y="38" width="5" height="4" fill="#ecb78b"/><rect x="25" y="38" width="5" height="4" fill="#ecb78b"/><rect x="9" y="8" width="14" height="17" fill="#161723"/><rect x="11" y="10" width="10" height="14" fill="#ecb78b"/><rect x="13" y="18" width="6" height="2" fill="#a77765"/><rect x="8" y="6" width="16" height="4" fill="#161723"/><rect x="10" y="7" width="12" height="2" fill="#68dbd1"/><rect x="8" y="10" width="3" height="12" fill="#161723"/><rect x="21" y="10" width="3" height="12" fill="#161723"/><rect x="8" y="12" width="3" height="9" fill="#6fd9df"/><rect x="21" y="12" width="3" height="9" fill="#6fd9df"/><rect x="12" y="14" width="3" height="3" fill="#161723"/><rect x="18" y="14" width="3" height="3" fill="#161723"/><rect x="15" y="15" width="3" height="1" fill="#161723"/><rect x="7" y="24" width="5" height="15" fill="#d9d45e"/><rect x="20" y="24" width="5" height="15" fill="#d9d45e"/><rect x="7" y="26" width="18" height="2" fill="#b0c8bd"/><rect x="10" y="31" width="13" height="7" fill="#161723"/><rect x="11" y="32" width="11" height="5" fill="#4b7376"/><rect x="12" y="33" width="2" height="2" fill="#f5a04a"/><rect x="16" y="33" width="2" height="2" fill="#71e891"/><rect x="20" y="33" width="2" height="2" fill="#ee6b6a"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="56" viewBox="0 0 32 56" shape-rendering="crispEdges">
|
||||
<title>Fan del pogo eterno</title>
|
||||
<rect x="6" y="49" width="9" height="7" fill="#161723"/><rect x="18" y="49" width="9" height="7" fill="#161723"/><rect x="7" y="51" width="7" height="4" fill="#c15e52"/><rect x="19" y="51" width="7" height="4" fill="#c15e52"/><rect x="9" y="38" width="6" height="13" fill="#161723"/><rect x="18" y="38" width="6" height="13" fill="#161723"/><rect x="10" y="39" width="4" height="11" fill="#315c67"/><rect x="19" y="39" width="4" height="11" fill="#315c67"/><rect x="5" y="22" width="22" height="19" fill="#161723"/><rect x="7" y="23" width="18" height="16" fill="#854a75"/><rect x="2" y="24" width="5" height="16" fill="#161723"/><rect x="25" y="24" width="5" height="16" fill="#161723"/><rect x="3" y="25" width="3" height="13" fill="#644c70"/><rect x="26" y="25" width="3" height="13" fill="#644c70"/><rect x="2" y="38" width="5" height="4" fill="#ecb78b"/><rect x="25" y="38" width="5" height="4" fill="#ecb78b"/><rect x="9" y="8" width="14" height="17" fill="#161723"/><rect x="11" y="10" width="10" height="14" fill="#ecb78b"/><rect x="13" y="18" width="6" height="2" fill="#a77765"/><rect x="12" y="1" width="8" height="10" fill="#161723"/><rect x="14" y="0" width="4" height="10" fill="#e4489d"/><rect x="9" y="4" width="5" height="7" fill="#161723"/><rect x="10" y="3" width="4" height="7" fill="#ff76c7"/><rect x="18" y="4" width="5" height="7" fill="#161723"/><rect x="18" y="3" width="3" height="7" fill="#ff76c7"/><rect x="10" y="14" width="4" height="2" fill="#161723"/><rect x="18" y="14" width="4" height="2" fill="#161723"/><rect x="14" y="20" width="5" height="2" fill="#161723"/><rect x="9" y="26" width="14" height="10" fill="#385a86"/><rect x="11" y="27" width="2" height="2" fill="#f6eecb"/><rect x="19" y="27" width="2" height="2" fill="#f6eecb"/><rect x="14" y="30" width="5" height="4" fill="#f3c9c3"/><rect x="16" y="32" width="1" height="2" fill="#161723"/><rect x="10" y="44" width="4" height="2" fill="#131a24"/><rect x="21" y="45" width="2" height="3" fill="#131a24"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="56" viewBox="0 0 32 56" shape-rendering="crispEdges">
|
||||
<title>Guitarrista rival</title>
|
||||
<rect x="6" y="49" width="9" height="7" fill="#161723"/><rect x="18" y="49" width="9" height="7" fill="#161723"/><rect x="7" y="51" width="7" height="4" fill="#553247"/><rect x="19" y="51" width="7" height="4" fill="#553247"/><rect x="9" y="38" width="6" height="13" fill="#161723"/><rect x="18" y="38" width="6" height="13" fill="#161723"/><rect x="10" y="39" width="4" height="11" fill="#292b42"/><rect x="19" y="39" width="4" height="11" fill="#292b42"/><rect x="5" y="22" width="22" height="19" fill="#161723"/><rect x="7" y="23" width="18" height="16" fill="#982f49"/><rect x="2" y="24" width="5" height="16" fill="#161723"/><rect x="25" y="24" width="5" height="16" fill="#161723"/><rect x="3" y="25" width="3" height="13" fill="#982f49"/><rect x="26" y="25" width="3" height="13" fill="#982f49"/><rect x="2" y="38" width="5" height="4" fill="#ecb78b"/><rect x="25" y="38" width="5" height="4" fill="#ecb78b"/><rect x="9" y="8" width="14" height="17" fill="#161723"/><rect x="11" y="10" width="10" height="14" fill="#ecb78b"/><rect x="13" y="18" width="6" height="2" fill="#a77765"/><rect x="8" y="5" width="16" height="8" fill="#161723"/><rect x="9" y="3" width="13" height="9" fill="#efcf57"/><rect x="6" y="9" width="4" height="20" fill="#dca83f"/><rect x="22" y="9" width="4" height="20" fill="#dca83f"/><rect x="10" y="15" width="2" height="2" fill="#161723"/><rect x="19" y="15" width="2" height="2" fill="#161723"/><rect x="14" y="20" width="4" height="2" fill="#161723"/><rect x="9" y="25" width="14" height="4" fill="#d35672"/><rect x="15" y="27" width="3" height="9" fill="#161723"/><rect x="22" y="24" width="3" height="18" fill="#161723"/><rect x="23" y="25" width="1" height="15" fill="#f1cd87"/><rect x="12" y="35" width="13" height="12" fill="#161723"/><rect x="15" y="35" width="11" height="9" fill="#ef8555"/><rect x="12" y="41" width="5" height="7" fill="#ec684c"/><rect x="20" y="42" width="4" height="6" fill="#f8ad62"/><rect x="18" y="38" width="3" height="2" fill="#f6eecb"/><rect x="18" y="42" width="3" height="2" fill="#f6eecb"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1,4 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="56" viewBox="0 0 32 56" shape-rendering="crispEdges">
|
||||
<title>Roadie del mas alla</title>
|
||||
<rect x="6" y="49" width="9" height="7" fill="#161723"/><rect x="18" y="49" width="9" height="7" fill="#161723"/><rect x="7" y="51" width="7" height="4" fill="#313440"/><rect x="19" y="51" width="7" height="4" fill="#313440"/><rect x="9" y="38" width="6" height="13" fill="#161723"/><rect x="18" y="38" width="6" height="13" fill="#161723"/><rect x="10" y="39" width="4" height="11" fill="#545568"/><rect x="19" y="39" width="4" height="11" fill="#545568"/><rect x="5" y="22" width="22" height="19" fill="#161723"/><rect x="7" y="23" width="18" height="16" fill="#35576d"/><rect x="2" y="24" width="5" height="16" fill="#161723"/><rect x="25" y="24" width="5" height="16" fill="#161723"/><rect x="3" y="25" width="3" height="13" fill="#35576d"/><rect x="26" y="25" width="3" height="13" fill="#35576d"/><rect x="2" y="38" width="5" height="4" fill="#ecb78b"/><rect x="25" y="38" width="5" height="4" fill="#ecb78b"/><rect x="9" y="8" width="14" height="17" fill="#161723"/><rect x="11" y="10" width="10" height="14" fill="#ecb78b"/><rect x="13" y="18" width="6" height="2" fill="#a77765"/><rect x="8" y="7" width="16" height="5" fill="#161723"/><rect x="10" y="5" width="14" height="5" fill="#b84f40"/><rect x="6" y="10" width="10" height="3" fill="#dc6c51"/><rect x="10" y="15" width="2" height="2" fill="#161723"/><rect x="19" y="15" width="2" height="2" fill="#161723"/><rect x="13" y="20" width="7" height="2" fill="#74534e"/><rect x="7" y="34" width="18" height="5" fill="#d5a156"/><rect x="10" y="34" width="4" height="5" fill="#fce98f"/><rect x="14" y="26" width="4" height="7" fill="#e1cf9b"/><rect x="15" y="27" width="2" height="3" fill="#161723"/><rect x="4" y="25" width="2" height="10" fill="#65869c"/><rect x="26" y="40" width="6" height="1" fill="#161723"/><rect x="31" y="41" width="1" height="8" fill="#161723"/><rect x="25" y="48" width="7" height="1" fill="#161723"/><rect x="24" y="43" width="1" height="6" fill="#161723"/><rect x="25" y="43" width="5" height="1" fill="#ffa760"/><rect x="29" y="44" width="1" height="3" fill="#ffa760"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#f37e6d" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><rect x="3" y="5" width="26" height="23" rx="2"/><rect x="6" y="12" width="20" height="13" rx="2" fill="#3b3443"/><circle cx="16" cy="18" r="6" fill="none" stroke="#bdb7d2" stroke-width="2"/><circle cx="10" cy="9" r="1.5" fill="#ffffb8"/><circle cx="16" cy="9" r="1.5" fill="#ffffb8"/></g></svg>
|
||||
|
After Width: | Height: | Size: 457 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#eac58c" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M7 26 24 5l3 3-17 20z"/><circle cx="25" cy="6" r="4" fill="#fff4d3"/><path d="m12 20 3 3" stroke="#fff" stroke-width="2"/></g></svg>
|
||||
|
After Width: | Height: | Size: 303 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#ffcd5b" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M7 10h16l-2 15H9z"/><path d="M23 12h4v8h-5" fill="none" stroke="#252132" stroke-width="3"/><path d="M8 10q2-8 5-3 4-7 7 0 5-4 6 3" fill="#fff4c7"/></g></svg>
|
||||
|
After Width: | Height: | Size: 328 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#f0ae55" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M4 13 16 5l12 8-3 11H7z"/><path d="M6 16h20l-2 4H8" fill="#65bf75"/><path d="M8 22h16" stroke="#fff3c7" stroke-width="3"/></g></svg>
|
||||
|
After Width: | Height: | Size: 303 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#b99afa" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M8 4h12v12l7 5v6H4v-7l4-4z"/><path d="M9 10h10M8 15h11" stroke="#f7e7ff" stroke-width="2"/></g></svg>
|
||||
|
After Width: | Height: | Size: 272 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#ec9fcd" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><rect x="3" y="7" width="26" height="20" rx="2"/><rect x="6" y="10" width="20" height="10" fill="#fff1dd"/><circle cx="11" cy="15" r="3" fill="#343048"/><circle cx="21" cy="15" r="3" fill="#343048"/><path d="M8 24h16" stroke="#343048" stroke-width="2"/></g></svg>
|
||||
|
After Width: | Height: | Size: 425 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#a1c1cc" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><circle cx="16" cy="16" r="12"/><circle cx="16" cy="16" r="6" fill="#343048"/><circle cx="16" cy="16" r="2" fill="#c8cfde"/></g></svg>
|
||||
|
After Width: | Height: | Size: 296 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#9b6243" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M7 10h17l-2 16H9z"/><path d="M24 12h3v10h-4" stroke="#252132" stroke-width="3" fill="none"/><path d="M12 4v4m7-4v4" stroke="#fff3d4" stroke-width="2"/></g></svg>
|
||||
|
After Width: | Height: | Size: 332 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#e5e6fc" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><circle cx="10" cy="10" r="6" fill="none" stroke="#f8faff" stroke-width="3"/><circle cx="22" cy="22" r="6" fill="none" stroke="#f8faff" stroke-width="3"/><path d="M14 7q17 0 7 18M6 15q2 11 18 7" stroke="#343048" stroke-width="2" fill="none"/></g></svg>
|
||||
|
After Width: | Height: | Size: 414 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#f55b78" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><rect x="9" y="5" width="14" height="23" rx="3"/><path d="M10 8h12M10 25h12" stroke="#fff" stroke-width="2"/><path d="m18 11-6 8h5l-3 6 8-10h-5z" fill="#fff9ac"/></g></svg>
|
||||
|
After Width: | Height: | Size: 334 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#82d8f3" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M5 26h22M5 6h22M8 24l16-4-16-4 16-4L8 8" stroke="#343048" stroke-width="3" fill="none"/></g></svg>
|
||||
|
After Width: | Height: | Size: 269 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#76bddc" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><rect x="6" y="4" width="20" height="24" rx="3"/><circle cx="16" cy="10" r="3" fill="#f9e68d"/><rect x="10" y="17" width="12" height="7" rx="1" fill="#343048"/></g></svg>
|
||||
|
After Width: | Height: | Size: 332 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#f9a047" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M4 5 27 11 12 28z"/><path d="m4 5 23 6" stroke="#d17d39" stroke-width="5"/><circle cx="15" cy="16" r="3" fill="#c54b5a"/><circle cx="19" cy="12" r="2" fill="#c54b5a"/></g></svg>
|
||||
|
After Width: | Height: | Size: 348 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#dc78f8" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M16 4Q3 3 5 14q2 9 11 15 12-10 12-17T16 4z"/><path d="m16 9-4 8h5l-2 7 7-11h-5z" fill="#fff"/></g></svg>
|
||||
|
After Width: | Height: | Size: 275 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#f1e7a3" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M7 3h16l4 5v21H7z"/><path d="M23 3v6h4M11 14h12M11 19h12M11 24h9" stroke="#584c46" stroke-width="2" fill="none"/></g></svg>
|
||||
|
After Width: | Height: | Size: 294 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#c2eb7e" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><path d="M8 5h6v20H8zM20 8h6v17h-6z"/><path d="M7 6h8M19 9h8" stroke="#fff" stroke-width="3"/></g></svg>
|
||||
|
After Width: | Height: | Size: 266 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><g fill="#83d0c5" stroke="#252132" stroke-width="1.6" stroke-linejoin="round"><rect x="4" y="10" width="24" height="17" rx="2"/><rect x="3" y="6" width="26" height="6" rx="2" fill="#defaff"/><path d="M10 18h12" stroke="#fff" stroke-width="3"/></g></svg>
|
||||
|
After Width: | Height: | Size: 337 B |
@@ -0,0 +1,96 @@
|
||||
# Objetos de Mortal Maze
|
||||
|
||||
Estado: **implementado** = recurso, icono SVG y efecto integrados en el jugador. Los valores son provisionales hasta playtesting.
|
||||
|
||||
Los SVG son de 32 x 32 px, y la escena `pickup.tscn` escala el Sprite2D a 0.5: **16 x 16 px visibles**, igual que el placeholder original.
|
||||
|
||||
| Objeto (recurso) | Descripcion | Efecto | Estado |
|
||||
|---|---|---|---|
|
||||
| **Espuma del Pogo** (`beer.tres`) | Espuma garantizada. El contenido, no tanto. | +30 PV | **Implementado** |
|
||||
| **Tostado del Averno** (`coffee.tres`) | 240 BPM por las venas. | +25% velocidad, 12 s | **Implementado** |
|
||||
| **Bocata del Roadie** (`bocata_roadie.tres`) | Lleva tres giras en la furgoneta. | +20 PV | **Implementado** |
|
||||
| **Pizza Post-Bolo** (`pizza_post_bolo.tres`) | La encontraron detras del amplificador. | +45 PV | **Implementado** |
|
||||
| **Tupper del Bateria** (`tupper_bateria.tres`) | Ni su madre recuerda que le puso. | +70 PV | **Implementado** |
|
||||
| **Lata de Feedback** (`lata_feedback.tres`) | Hace mas ruido al abrirse que el guitarrista. | +15% velocidad, 20 s | **Implementado** |
|
||||
| **Botas del Doble Bombo** (`botas_doble_bombo.tres`) | El bateria marca el ritmo de la carrera. | +35% velocidad, 8 s | **Implementado** |
|
||||
| **Pua del Apocalipsis** (`pua_apocalipsis.tres`) | Tres acordes. Cero supervivientes. | +30% daño básico/aéreo, 12 s | **Implementado** |
|
||||
| **Pedal de Distorsion** (`pedal_distorsion.tres`) | El tecnico de sonido ha dimitido. | +50% daño básico/aéreo, 7 s | **Implementado** |
|
||||
| **Cuerda de Titanio** (`cuerda_titanio.tres`) | No desafina. Tampoco perdona. | +20% daño básico/aéreo, 20 s | **Implementado** |
|
||||
| **Casete de la Demo Perdida** (`casete_demo.tres`) | Grabado en un garaje. Se nota. | +25 especial | **Implementado** |
|
||||
| **Setlist del Fin del Mundo** (`setlist_fin.tres`) | Si no queda escenario, el orden da igual. | +50 especial | **Implementado** |
|
||||
| **Amplificador al 11** (`amplificador_11.tres`) | El 10 era para cobardes. | +100 especial | **Implementado** |
|
||||
| **Cinta Americana Infinita** (`cinta_americana.tres`) | Arregla todo, menos la afinacion. | Absorbe el próximo golpe | **Implementado** |
|
||||
| **Tapones del Tecnico** (`tapones_tecnico.tres`) | Por una vez, el tecnico tenia razon. | -25% daño recibido, 12 s | **Implementado** |
|
||||
| **Muelles del Stage Diving** (`muelles_stage.tres`) | El aterrizaje no esta incluido. | +20% impulso de salto, 12 s | **Implementado** |
|
||||
| **Baqueta Sismica** (`baqueta_sismica.tres`) | Una prueba de sonido y desaparecio el suelo. | +50% daño aéreo adicional, 10 s | **Implementado** |
|
||||
|
||||
## Distribución y reglas
|
||||
|
||||
- Walker normal: 50% de probabilidad de soltar 1 objeto al morir; tabla ponderada en `enemies/walker/walker_drop.tres`.
|
||||
- En el laboratorio `levels/level_01.tscn`: `guaranteed_drop` asignado en cada uno de los 17 enemigos, 100% de probabilidad y sin respawn. No cambia el drop normal.
|
||||
- `Muelles del Stage Diving` y `Baqueta Sismica` no están en la tabla aleatoria normal, pero **sí** se pueden probar derrotando las estaciones 15 y 16 del laboratorio.
|
||||
- Las curaciones no se consumen si ya tienes la vida completa; el especial tampoco si está lleno. El propio objeto lo indica con `HP LLENO` / `ESPECIAL LLENO`, y reintenta la recogida si sigues tocandolo y cambia el estado.
|
||||
- Las mejoras de igual tipo renuevan duración y conservan la mayor potencia (no se multiplican entre sí). Mejoras de tipos diferentes conviven. La velocidad se multiplica por `1 + value` y el HUD muestra el porcentaje y velocidad efectiva.
|
||||
- Los drops de enemigos esperan 0,75 s para aplicar el efecto, pero recuerdan un contacto durante la espera: no se pierde una recompensa por pasar corriendo. El disparador fisico es 28 x 24; el sprite visible sigue siendo 16 x 16.
|
||||
- El escudo bloquea un golpe y aplica la invulnerabilidad habitual del jugador.
|
||||
- Los sprites son iconos originales vectoriales, no se reutilizan imágenes de terceros.
|
||||
|
||||
## Prueba de todos los objetos en una APK
|
||||
|
||||
- **Implementado en escena:** 17 estaciones ordenadas de izquierda a derecha,
|
||||
cada una con un enemigo visual diferente (cinco variantes cíclicas) y un drop
|
||||
fijo. El HUD cuenta objetos *recogidos*, no enemigos eliminados.
|
||||
- **Implementado en código:** el HUD del jugador muestra los efectos temporales
|
||||
y el escudo. Carga especial/curación requieren capacidad disponible para
|
||||
consumirse; a tope permanecen en el suelo.
|
||||
- **Por validar:** importación SVG, colisiones, caídas de los items, equilibrio,
|
||||
funcionamiento con controles táctiles y exportación APK en un teléfono real.
|
||||
- **Guía:** [Test de Level 01](test_level_01.md) (orden de recompensas y checklist).
|
||||
|
||||
## Pendiente (no implementado)
|
||||
|
||||
| Coleccionable | Descripción | Estado |
|
||||
|---|---|---|
|
||||
| La Pua Perdida | Lleva desaparecida desde el primer concierto. Estaba debajo del sofá. | Pendiente: sistema de coleccionables |
|
||||
| La Primera Maqueta | La grabaron en 2008. Todavía están intentando mezclarla. | Pendiente: sistema de coleccionables |
|
||||
| El Calcetin del Bajista | Nadie sabe de quien es. Todos saben que hay que alejarse. | Pendiente: sistema de coleccionables |
|
||||
| La Factura del Local | Impagada desde tiempos inmemoriales. | Pendiente: sistema de coleccionables |
|
||||
|
||||
## Añadir un objeto
|
||||
|
||||
1. Duplica un `.tres` de `pickups/data/`; cambia `id`, `display_name`, `description`, `icon`, `effect_type`, `value` y `duration`.
|
||||
2. Coloca un SVG 32×32 en `assets/pickups/`; Godot lo importa como Texture2D.
|
||||
3. Si debe caer de enemigos, añade una entrada `PickupDrop` con su peso en `enemies/walker/walker_drop.tres`.
|
||||
4. Si requiere una mecánica nueva, añádela expresamente en `Player.collect_pickup()` y documenta aquí su efecto.
|
||||
5. Prueba a recogerlo con vida/especial llenos, dos veces seguidas y justo cuando expira.
|
||||
|
||||
## Comprobaciones pendientes
|
||||
|
||||
- Probar visualmente las importaciones SVG y cada efecto en Godot 4.7.
|
||||
- Equilibrar tiempos y probabilidades tras jugar varios niveles.
|
||||
- Validar que los indicadores persistentes del HUD se ven y se actualizan
|
||||
correctamente en Android (implementados en código, aún no probados en dispositivo).
|
||||
- Revisar la clasificación por edades con el cuestionario IARC/Google Play; nombres ficticios no garantizan ninguna clasificación.
|
||||
|
||||
### Importante: colores en recursos `.tres`
|
||||
|
||||
Un archivo `.tres` debe escribir colores con cuatro componentes numericos:
|
||||
|
||||
```ini
|
||||
color = Color(1.0, 0.803922, 0.356863, 1.0)
|
||||
```
|
||||
|
||||
No uses `Color("#ffcd5b")` en un `.tres`: esa forma es valida en codigo
|
||||
GDScript, pero el parser de recursos de Godot no la admite. Es lo que impedia
|
||||
cargar los objetos y hacia que apareciese el cuadro blanco llamado `Item`.
|
||||
La prueba `tests/test_pickup_resources.py` impide volver a introducirlo.
|
||||
|
||||
## Objetos colocados en Level 02
|
||||
|
||||
`levels/level_02.tscn` es una **alfa de campo**, no otra prueba de 17 drops
|
||||
fijos. Hay 14 objetos en `Items/PickupXX`, con curaciones, especial,
|
||||
movimiento, escudo, defensa y daño aéreo. Parte de ellos se sitúa en
|
||||
plataformas altas. Además, los 29 enemigos comparten su sistema normal de
|
||||
drops ponderados; tres tienen curación garantizada para sostener el recorrido.
|
||||
Al tener los cuatro protagonistas 50 HP, los valores de curación se limitan
|
||||
al HP que realmente falte. Ver [guía del Level 02](level_02.md).
|
||||
@@ -0,0 +1,149 @@
|
||||
# Level 02 — Calle del Feedback (alfa urbana)
|
||||
|
||||
**Estado:** implementado en recursos/escena; faltan pruebas con Godot y en Android.
|
||||
Este es el nivel de inicio (`run/main_scene` en `project.godot`), para que la
|
||||
siguiente APK entre directamente en esta prueba de campo. El laboratorio de los
|
||||
17 drops sigue accesible en `levels/level_01.tscn`.
|
||||
|
||||
## Recorrido
|
||||
|
||||
- **11.000 unidades** de izquierda a derecha, con meta en x=10.850.
|
||||
- **8 calles consecutivas** (sin agujeros obligatorios). Hay ascensos por
|
||||
escalones de 85–105 px y descensos de 55–175 px. Se puede completar
|
||||
recorriendo el suelo, saltando los escalones; los tejados son opcionales.
|
||||
- **11 plataformas unidireccionales**, incluidas tres rutas de dos alturas
|
||||
(x≈800–1065, x≈3070–3500 y x≈5680–6090). Hay que usar la plataforma
|
||||
inferior antes de subir a la superior; puedes atravesarlas desde abajo.
|
||||
- **29 enemigos** distribuidos por el recorrido: cinco variantes humanoides
|
||||
con la misma IA Walker. Hay encuentros individuales y grupos de 2 o 3.
|
||||
No reaparecen. En este nivel se usa **el drop normal aleatorio**;
|
||||
tres enemigos tienen un drop fijo de curación como ayuda para la alfa.
|
||||
- **14 pickups colocados en el escenario**, algunos en lugares elevados.
|
||||
Son los mismos recursos `PickupData` que funcionan en Level 01.
|
||||
- **Barreras de colisión** a x=0 y x=11.000, visibles en píxeles, para
|
||||
impedir salir por los extremos.
|
||||
- HUD de progreso (sector y bajas), meta con resultado y reinicio tras 9 s.
|
||||
- El especial tiene un radio de 290 unidades **solo en este nivel**, para no
|
||||
matar enemigos de zonas enteras a la vez.
|
||||
|
||||
### Calle principal
|
||||
|
||||
| Tramo x | Altura del suelo (y) | Mecánica |
|
||||
|---|---:|---|
|
||||
| 0–1.480 | 845 | Introducción, primer tejado con recompensa |
|
||||
| 1.480–2.810 | 755 | Subir un escalón, combate por parejas |
|
||||
| 2.810–4.150 | 890 | Bajada y primera triple pelea |
|
||||
| 4.150–5.500 | 805 | Segundo ascenso |
|
||||
| 5.500–6.800 | 700 | Zona alta, tejados dobles y tres enemigos |
|
||||
| 6.800–8.080 | 875 | Gran descenso y otro grupo de tres |
|
||||
| 8.080–9.360 | 785 | Ascenso, plataforma alta opcional |
|
||||
| 9.360–11.000 | 845 | Última pelea triple y meta |
|
||||
|
||||
Todas las alturas son coordenadas `y` de Godot (menor `y` equivale a mayor
|
||||
altura en pantalla). El personaje tiene doble salto; el camino principal no
|
||||
requiere un salto potenciado ni recoger un objeto específico.
|
||||
|
||||
## Arte y parallax
|
||||
|
||||
Los 15 PNG originales de `assets/city/` comparten una paleta de azules,
|
||||
malvas y ocres apagados. Son pixel art pintado sobre cuadrícula y exportado
|
||||
con escalado *nearest neighbour*, no imágenes de terceros.
|
||||
|
||||
| Arte | Destino |
|
||||
|---|---|
|
||||
| `sky.png` | Cielo nocturno de 1024×1280, parallax 0.00 |
|
||||
| `clouds.png` | Nubes que se mueven solas, parallax 0.12 |
|
||||
| `skyline_far.png` | Perfil de la ciudad lejana, parallax 0.23 |
|
||||
| `skyline_mid.png` | Edificios intermedios, parallax 0.46 |
|
||||
| `facade_01.png` … `facade_06.png` | 34 fachadas distribuidas en toda la calle |
|
||||
| `asphalt.png`, `curb.png` | Suelo urbano con textura repetida |
|
||||
| `walkway.png` | Pasarelas metálicas, editables en la escena |
|
||||
| `barrier.png` | Barreras en los dos extremos |
|
||||
| `streetlamp.png` | Farolas decorativas |
|
||||
|
||||
Las cuatro capas `Parallax2D` repiten cada 1.024 px. La vertical permanece
|
||||
anclada al mundo (`scroll_scale.y = 1`), incluso al saltar. El PNG del cielo
|
||||
cubre la altura de cámara. No se crea una imagen de 11.000 píxeles de ancho,
|
||||
lo que facilita mantener el escenario ligero para Android.
|
||||
|
||||
Para regenerar el arte de forma reproducible:
|
||||
|
||||
```bash
|
||||
python -m pip install Pillow
|
||||
python tools/generate_city_art.py
|
||||
```
|
||||
|
||||
Pillow solo es necesario para **regenerar** el PNG, no para abrir Godot,
|
||||
jugar, ejecutar los tests ni exportar Android. Los PNG ya están versionados.
|
||||
|
||||
## Equilibrio inicial
|
||||
|
||||
Este cambio afecta a ambos niveles porque usa los recursos compartidos:
|
||||
|
||||
- **Personajes:** los cuatro `CharacterData` tienen **50 HP** (antes 100).
|
||||
- **Puñetazo normal:** 5 de daño base (sin cambios).
|
||||
- **Ground pound:** 7 de daño mínimo, aumenta con la altura hasta **12 de
|
||||
daño máximo**, incluso con multiplicadores de objetos. Los buffs ayudan
|
||||
a llegar antes al límite, pero no lo sobrepasan.
|
||||
- **Enemigos:** Fan 11 HP / 2 daño; Roadie 14 HP / 2 daño; Técnico 16 HP /
|
||||
2 daño; Guitarrista Rival 17 HP / 3 daño; Guardia 21 HP / 3 daño.
|
||||
- La probabilidad de drops normales y las funciones de recogida que ya
|
||||
funcionan **no se han modificado**.
|
||||
|
||||
Con 50 HP, las curaciones de 45 o 70 HP siguen funcionando: recuperan solo
|
||||
los puntos faltantes hasta el máximo. El resto del catálogo no se reequilibra
|
||||
aún para evitar cambiar demasiadas variables simultáneamente.
|
||||
|
||||
## Modificar el nivel
|
||||
|
||||
- **Terreno:** editar colisiones `World/Ground/StreetXX` o
|
||||
`World/Walkways/WalkwayXX` en Godot. El script
|
||||
`levels/level_02.gd::_draw()` lee los mismos rectángulos para renderizar
|
||||
asfalto, bordillos y pasarelas: no hay geometría duplicada en código.
|
||||
- **Enemigos:** instancias `Enemies/EnemyXX`. Se puede mover cualquiera,
|
||||
sustituir su variante, editar `max_health` individual o establecer
|
||||
`guaranteed_drop` si se quiere un objeto fijo.
|
||||
- **Pickups:** instancias `Items/PickupXX`, editando `pickup_data` por
|
||||
cualquier recurso `.tres` existente.
|
||||
- **Decoración:** `Facades` y `StreetProps` son visuales sin colisión; las
|
||||
calles y plataformas son la fuente de verdad de la geometría.
|
||||
- **Cámara y meta:** `levels/level_02.gd` y `FinishZone`.
|
||||
|
||||
## Pruebas pendientes en Godot / APK
|
||||
|
||||
- [ ] En Android se inicia `Level02` y aparecen cielo, edificios y nubes.
|
||||
- [ ] Las nubes se desplazan más lentamente que los edificios al correr.
|
||||
- [ ] El fondo no deja franjas vacías al avanzar hasta x=11.000.
|
||||
- [ ] El dibujo del suelo coincide con las colisiones en los ocho tramos.
|
||||
- [ ] Se puede subir los cuatro escalones sin necesitar un buff.
|
||||
- [ ] Los dos saltos encadenados de los tejados son posibles con controles táctiles.
|
||||
- [ ] Se puede bajar a la calle y los enemigos no atraviesan el suelo.
|
||||
- [ ] Varios enemigos atacan juntos y los 50 HP son jugables; ajustar después.
|
||||
- [ ] Ground pound muestra daño entre 7 y 12, nunca más de 12 con buffs.
|
||||
- [ ] Las curaciones, carga y velocidad se pueden recoger en el campo.
|
||||
- [ ] Las dos barreras detienen al jugador y la meta muestra el resultado.
|
||||
- [ ] Se puede completar, morir y reiniciar correctamente en Android.
|
||||
|
||||
### Arrancar otra vez Level 01
|
||||
|
||||
En `project.godot`, cambiar temporalmente:
|
||||
|
||||
```ini
|
||||
run/main_scene="res://levels/level_01.tscn"
|
||||
```
|
||||
|
||||
O abrir `levels/level_01.tscn` directamente en Godot y pulsar **F6** para
|
||||
jugar esa escena sin modificar la escena de inicio del proyecto.
|
||||
|
||||
### Comprobaciones automáticas
|
||||
|
||||
```bash
|
||||
python -m unittest discover -s tests -v
|
||||
godot --headless --path . --editor --quit
|
||||
godot --headless --path . --script res://tests/test_level_02_runtime.gd
|
||||
```
|
||||
|
||||
Las pruebas Python verifican la estructura, recursos y continuidad del
|
||||
camino, **no sustituyen una partida**. Las dos últimas líneas requieren
|
||||
Godot 4.7 y sus importaciones; la validación visual de parallax y colisiones
|
||||
se debe completar en el motor/dispositivo.
|
||||
@@ -0,0 +1,182 @@
|
||||
# Level 01 - Laboratorio de objetos (Android)
|
||||
|
||||
**Implementado en escena / pendiente de validar jugando en Godot y Android.**
|
||||
|
||||
`levels/level_01.tscn` es un recorrido deliberadamente largo para probar una
|
||||
APK sin alterar el codigo entre partidas. Desde Level 02, **ya no es la escena inicial**: ábrelo con F6 o cambia
|
||||
`run/main_scene` temporalmente como se indica en [Level 02](level_02.md).
|
||||
|
||||
- **17 enemigos / 17 objetos diferentes**, uno por enemigo, en este orden.
|
||||
- Un **pickup de control adicional** (x=270) aparece sin matar a nadie:
|
||||
sirve para diferenciar un problema de dibujo/recogida de uno de muerte/drop.
|
||||
Es un objeto de pruebas (`lab_control.tres`) y **no cuenta** entre los 17.
|
||||
Se recoge inmediatamente al tocarlo (sin espera).
|
||||
- Cada enemigo suelta **siempre** su objeto asignado al morir y **no reaparece**.
|
||||
En este laboratorio, el nivel observa `is_dead` y crea el objeto **una vez**;
|
||||
no depende de la senal `died` ni de la tabla aleatoria. En otras escenas,
|
||||
Walker mantiene intactos sus drops habituales.
|
||||
- La tabla normal `enemies/walker/walker_drop.tres` conserva su 50% aleatorio
|
||||
en las otras escenas (no se ha desactivado globalmente).
|
||||
- Suelo continuo para no quedarse atascado, con 7 plataformas opcionales.
|
||||
La primera plataforma alta (x=1690, y=291) esta concebida para alcanzarse
|
||||
desde la baja (x=1530, y=455), no directamente desde el suelo. Hay doble salto.
|
||||
- La camara acompana todo el recorrido (hasta x=8500).
|
||||
- Etiquetas sobre cada enemigo y contador en la esquina superior derecha.
|
||||
- HUD izquierda: vida, carga especial y mejoras temporales; para velocidad muestra bono porcentual, velocidad efectiva y segundos.
|
||||
- La meta esta en **x=8180**; muestra resultados y reinicia tras 8 segundos.
|
||||
- En esta escena el especial tiene radio de 290 unidades para evitar eliminar
|
||||
enemigos de estaciones vecinas antes de llegar a ellas.
|
||||
|
||||
## Encuentros y recompensas
|
||||
|
||||
| # | X | Enemigo (aspecto) | Drop fijo | Archivo de datos |
|
||||
|---|---:|---|---|---|
|
||||
| 01 | 480 | Roadie del Mas Alla | **Pua del Apocalipsis** | `pua_apocalipsis.tres` |
|
||||
| 02 | 930 | Fan del Pogo Eterno | **Espuma del Pogo** | `beer.tres` |
|
||||
| 03 | 1380 | Tecnico del Feedback | **Tostado del Averno** | `coffee.tres` |
|
||||
| 04 | 1830 | Guardia del Camerino | **Casete de la Demo Perdida** | `casete_demo.tres` |
|
||||
| 05 | 2280 | Guitarrista Rival | **Bocata del Roadie** | `bocata_roadie.tres` |
|
||||
| 06 | 2730 | Roadie del Mas Alla | **Lata de Feedback** | `lata_feedback.tres` |
|
||||
| 07 | 3180 | Fan del Pogo Eterno | **Pedal de Distorsion** | `pedal_distorsion.tres` |
|
||||
| 08 | 3630 | Tecnico del Feedback | **Setlist del Fin del Mundo** | `setlist_fin.tres` |
|
||||
| 09 | 4080 | Guardia del Camerino | **Pizza Post-Bolo** | `pizza_post_bolo.tres` |
|
||||
| 10 | 4530 | Guitarrista Rival | **Cuerda de Titanio** | `cuerda_titanio.tres` |
|
||||
| 11 | 4980 | Roadie del Mas Alla | **Cinta Americana Infinita** | `cinta_americana.tres` |
|
||||
| 12 | 5430 | Fan del Pogo Eterno | **Tapones del Tecnico** | `tapones_tecnico.tres` |
|
||||
| 13 | 5880 | Tecnico del Feedback | **Tupper del Bateria** | `tupper_bateria.tres` |
|
||||
| 14 | 6330 | Guardia del Camerino | **Botas del Doble Bombo** | `botas_doble_bombo.tres` |
|
||||
| 15 | 6780 | Guitarrista Rival | **Muelles del Stage Diving** | `muelles_stage.tres` |
|
||||
| 16 | 7230 | Roadie del Mas Alla | **Baqueta Sismica** | `baqueta_sismica.tres` |
|
||||
| 17 | 7680 | Fan del Pogo Eterno | **Amplificador al 11** | `amplificador_11.tres` |
|
||||
|
||||
## Que comprobar en la APK
|
||||
|
||||
- [ ] Antes de matar a nadie debe verse un objeto con el cartel
|
||||
**CONTROL: objeto SIN matar**. Su nombre es **Testigo del Laboratorio**
|
||||
y muestra un icono de cinta, no un cuadrado blanco con texto "Item".
|
||||
Al tocarlo inmediatamente se concede un escudo, pero
|
||||
el contador de los 17 objetos de estaciones no cambia.
|
||||
- [ ] En la esquina superior derecha se ve **LAB DROPS v4**. Si aparece
|
||||
**script SIN iniciar**, el `level_01.gd` no se ha ejecutado. Si no aparece
|
||||
**LAB DROPS v4**, estas usando otra version del proyecto/APK.
|
||||
- [ ] Al matar el primer enemigo: `KOs: 01`, `Creados: 01` y `Suelo` suma
|
||||
un pickup (salvo que ya se haya recogido). `Senales` es un diagnostico
|
||||
adicional, no controla los drops.
|
||||
|
||||
- [ ] Con `level_01` seleccionado como escena de inicio, la APK lo abre y se puede caminar a derecha durante
|
||||
todo el nivel y la camara no se detiene en x=4000.
|
||||
- [ ] Los 17 enemigos tienen apariencia humanoide visible y ataques legibles.
|
||||
- [ ] Cada muerte deja el objeto esperado (no uno aleatorio), una sola vez.
|
||||
- [ ] La etiqueta del siguiente objeto y el contador coinciden con la partida.
|
||||
- [ ] Al recoger objetos, sus efectos se notan; buffs y escudo se listan a la izquierda.
|
||||
- [ ] En la estación 03, al recoger **Tostado del Averno**, aparece `VEL +25% | 488 px/s` (390 px/s sin buff) durante 12 s. En Android, compara cuánto terreno avanzas manteniendo pulsada la derecha.
|
||||
- [ ] Atraviesa un drop mientras está cayendo (antes de 0,75 s) y sigue corriendo: el contacto debe contar aunque ya te hayas alejado al terminar la espera.
|
||||
- [ ] Si un objeto muestra `HP LLENO` o `ESPECIAL LLENO`, no es un fallo de colisión: necesitas perder HP o gastar especial. Sin salir de su zona, debe poder recogerse al cambiar ese estado.
|
||||
- [ ] Vida llena: las curaciones permanecen en el suelo hasta necesitar HP.
|
||||
- [ ] Especial lleno: los objetos de carga permanecen hasta consumir el especial (SP).
|
||||
- [ ] Las dos mejoras de salto/ataque aereo se pueden probar en las plataformas.
|
||||
- [ ] Hay que saltar a la plataforma baja para alcanzar la alta.
|
||||
- [ ] Al llegar a la meta se ve el resumen y vuelve a empezar tras 8 s.
|
||||
|
||||
**Nota:** El contador marca objetos efectivamente *recogidos*, no enemigos
|
||||
muertos. Para obtener 17/17 hay que haber perdido vida antes de tomar curaciones
|
||||
y haber gastado especial antes de tomar cargadores si esta lleno. Los objetos
|
||||
no desaparecen por tiempo; puedes volver a recogerlos.
|
||||
|
||||
## Como cambiar una estacion
|
||||
|
||||
En `levels/level_01.tscn`, selecciona `TestEnemies/StationXX` y cambia
|
||||
`guaranteed_drop` por un recurso de `pickups/data/`. En esta escena no necesitas
|
||||
modificar la tabla de drops. El valor `respawn_delay = 0` viene del perfil del
|
||||
enemigo (en `enemies/variants/`). Para volver al reparto aleatorio en un nivel
|
||||
normal, deja `guaranteed_drop` vacio y usa el Walker original.
|
||||
|
||||
Los cinco perfiles usan el script `enemies/walker/walker.gd`. Son variantes
|
||||
**visuales y de estadisticas**, no cinco IA diferentes:
|
||||
|
||||
- Roadie del Mas Alla: mochila/cable y gorra.
|
||||
- Fan del Pogo Eterno: cresta y chaleco de festival.
|
||||
- Tecnico del Feedback: auriculares, chaleco y mesa de sonido.
|
||||
- Guardia del Camerino: traje y gafas de sol.
|
||||
- Guitarrista Rival: melenas y guitarra electrica.
|
||||
|
||||
Sprites SVG de **32x56** (`assets/enemies/`) para una colision aprox. **28x52**.
|
||||
Los objetos mantienen iconos SVG de **32x32** y representacion a **16x16**.
|
||||
|
||||
## Verificacion antes de exportar
|
||||
|
||||
Desde la raiz del proyecto:
|
||||
|
||||
```bash
|
||||
python -m unittest discover -s tests -v
|
||||
```
|
||||
|
||||
Esto valida rutas, SVG, drops y el layout basico, **pero no ejecuta Godot**.
|
||||
Abre el proyecto en Godot una vez para importar los SVG y probar la escena.
|
||||
Para generar un APK en un entorno que tenga Godot y el SDK Android configurados:
|
||||
|
||||
```bash
|
||||
./scripts/export_android_debug.sh
|
||||
```
|
||||
|
||||
El script admite una ruta de salida opcional; por defecto escribe
|
||||
`build/android/mortal-maze-debug.apk`. No se ha compilado la APK aqui.
|
||||
|
||||
## Diagnostico de los drops (version 3)
|
||||
|
||||
**Orden de comprobacion, sin modificar el proyecto:**
|
||||
|
||||
1. Al entrar en el nivel, verifica que el HUD empieza con `LAB DROPS v4`.
|
||||
Si pone `script SIN iniciar`, hay un problema de carga de `level_01.gd`.
|
||||
Si no pone `LAB DROPS v4`, no estas ejecutando esta version del nivel.
|
||||
2. Sin matar a nadie, camina a la derecha hasta el objeto **CONTROL** (x=270).
|
||||
Es una instancia directa de `pickup.tscn`. Si tampoco aparece, el fallo
|
||||
esta en el renderizado/instanciacion del pickup, no en los drops de enemigos.
|
||||
3. Mata al primer enemigo. El HUD distingue **KOs** (enemigos observados
|
||||
muertos), **Senales** (senales `died` recibidas), **Creados** (objetos
|
||||
solicitados) y **Suelo** (pickups vivos, incluido el de control).
|
||||
- `KOs=0`, `Senales=0`: el estado `is_dead` no ha cambiado, o el codigo del
|
||||
nivel no se esta ejecutando. Comprueba que el enemigo se vuelva invisible
|
||||
y que su barra de vida se agote.
|
||||
- `KOs=1`, `Creados=1`, pero no hay objeto: el problema esta en la creacion
|
||||
o el dibujo del pickup. Mira las lineas `LAB DROPS v4:` de la consola.
|
||||
- `KOs=1`, `Senales=0`, `Creados=1`: la senal se perdio, pero el laboratorio
|
||||
ha creado el objeto igualmente gracias a la observacion de `is_dead`.
|
||||
|
||||
El objeto de control concede escudo y **no cuenta** entre las 17 recompensas.
|
||||
Las curaciones y cargas de especial no pueden recogerse si esas barras estan
|
||||
llenas; no es un fallo del drop. Solo los pickups **generados por la muerte de un enemigo** esperan 0,75 s
|
||||
antes de poder aplicar su efecto. Si el jugador lo toca durante la espera, ese
|
||||
contacto se conserva hasta que termina el tiempo, aunque siga corriendo. Los
|
||||
solapamientos se comprueban cada paso de fisica (no solo al entrar por primera
|
||||
vez), y el area de recogida es 28 x 24 sin alterar los 16 x 16 pixeles visibles.
|
||||
El objeto fijo de control se recoge sin espera y todos permanecen en el suelo
|
||||
indefinidamente si no se pueden utilizar. En el propio objeto se indica
|
||||
`HP LLENO` o `ESPECIAL LLENO` cuando corresponda.
|
||||
|
||||
Pruebas automaticas (con Godot 4.7 instalado e iconos SVG importados):
|
||||
|
||||
```bash
|
||||
godot --headless --path . --editor --quit
|
||||
godot --headless --path . --script res://tests/test_pickup_runtime.gd
|
||||
```
|
||||
|
||||
La prueba desconecta **una** senal `died` intencionadamente y verifica que se
|
||||
siguen creando exactamente los 17 drops, que el contador marca 17 KOs, que
|
||||
existe el pickup de control y que no hay duplicados. Ademas prueba cruzar un
|
||||
drop durante su espera, volver a intentar una curacion cuando baja la vida
|
||||
y comprobar que el aumento de velocidad modifica el movimiento real.
|
||||
Esta prueba **no se ha podido ejecutar en este entorno**: aqui no existe
|
||||
el ejecutable de Godot.
|
||||
|
||||
## Error resuelto: recursos con colores no serializables
|
||||
|
||||
Los 18 recursos de `pickups/data/` tenian colores escritos como
|
||||
`Color("#ffcd5b")`: esa expresion sirve en GDScript, **pero no en un `.tres`**.
|
||||
El parser de Godot para archivos de recursos exige `Color(r, g, b, a)` con
|
||||
cuatro numeros. Por ello los datos se podian perder al cargar, dejando el
|
||||
texto `Item`, el cuadro blanco y ninguna recompensa asociada al enemigo.
|
||||
|
||||
Para cualquier item nuevo, deja que Godot guarde el `.tres` desde el Inspector
|
||||
(o escribe `Color(1.0, 0.8, 0.36, 1.0)` de forma explicita). La prueba
|
||||
`tests/test_pickup_resources.py` verifica este formato para todos los recursos.
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://enemies/walker/walker.tscn" id="1_walker"]
|
||||
[ext_resource type="Texture2D" path="res://assets/enemies/backstage_guard.svg" id="2_sprite"]
|
||||
|
||||
[node name="Walker" instance=ExtResource("1_walker")]
|
||||
enemy_display_name = "Guardia del Camerino"
|
||||
move_speed = 70.0
|
||||
max_health = 21
|
||||
attack_damage = 3
|
||||
chase_radius = 135.0
|
||||
respawn_delay = 0.0
|
||||
show_debug_hitboxes = false
|
||||
|
||||
[node name="Visual" parent="." index="0"]
|
||||
texture = ExtResource("2_sprite")
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://enemies/walker/walker.tscn" id="1_walker"]
|
||||
[ext_resource type="Texture2D" path="res://assets/enemies/feedback_tech.svg" id="2_sprite"]
|
||||
|
||||
[node name="Walker" instance=ExtResource("1_walker")]
|
||||
enemy_display_name = "Tecnico del Feedback"
|
||||
move_speed = 55.0
|
||||
max_health = 16
|
||||
attack_damage = 2
|
||||
chase_radius = 135.0
|
||||
respawn_delay = 0.0
|
||||
show_debug_hitboxes = false
|
||||
|
||||
[node name="Visual" parent="." index="0"]
|
||||
texture = ExtResource("2_sprite")
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://enemies/walker/walker.tscn" id="1_walker"]
|
||||
[ext_resource type="Texture2D" path="res://assets/enemies/pogo_fan.svg" id="2_sprite"]
|
||||
|
||||
[node name="Walker" instance=ExtResource("1_walker")]
|
||||
enemy_display_name = "Fan del Pogo Eterno"
|
||||
move_speed = 105.0
|
||||
max_health = 11
|
||||
attack_damage = 2
|
||||
chase_radius = 135.0
|
||||
respawn_delay = 0.0
|
||||
show_debug_hitboxes = false
|
||||
|
||||
[node name="Visual" parent="." index="0"]
|
||||
texture = ExtResource("2_sprite")
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://enemies/walker/walker.tscn" id="1_walker"]
|
||||
[ext_resource type="Texture2D" path="res://assets/enemies/rival_guitarist.svg" id="2_sprite"]
|
||||
|
||||
[node name="Walker" instance=ExtResource("1_walker")]
|
||||
enemy_display_name = "Guitarrista Rival"
|
||||
move_speed = 87.0
|
||||
max_health = 17
|
||||
attack_damage = 3
|
||||
chase_radius = 135.0
|
||||
respawn_delay = 0.0
|
||||
show_debug_hitboxes = false
|
||||
|
||||
[node name="Visual" parent="." index="0"]
|
||||
texture = ExtResource("2_sprite")
|
||||
@@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://enemies/walker/walker.tscn" id="1_walker"]
|
||||
[ext_resource type="Texture2D" path="res://assets/enemies/roadie.svg" id="2_sprite"]
|
||||
|
||||
[node name="Walker" instance=ExtResource("1_walker")]
|
||||
enemy_display_name = "Roadie del Mas Alla"
|
||||
move_speed = 65.0
|
||||
max_health = 14
|
||||
attack_damage = 2
|
||||
chase_radius = 135.0
|
||||
respawn_delay = 0.0
|
||||
show_debug_hitboxes = false
|
||||
|
||||
[node name="Visual" parent="." index="0"]
|
||||
texture = ExtResource("2_sprite")
|
||||
@@ -9,6 +9,7 @@ signal died
|
||||
# actually share instead of guessing an abstraction in advance.
|
||||
|
||||
const PLAYER_HURTBOX_MASK: int = 1 << 3
|
||||
const DROP_MANAGER := preload("res://pickups/drop_manager.gd")
|
||||
|
||||
|
||||
enum AttackState {
|
||||
@@ -25,8 +26,8 @@ enum AttackState {
|
||||
|
||||
@export_category("Movement")
|
||||
|
||||
@export var move_speed: float = 85.0
|
||||
@export var max_fall_speed: float = 1200.0
|
||||
@export var move_speed: float = 78.0
|
||||
@export var max_fall_speed: float = 800.0
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -35,7 +36,7 @@ enum AttackState {
|
||||
|
||||
@export_category("Combat")
|
||||
|
||||
@export_range(1, 100, 1) var max_health: int = 3
|
||||
@export_range(1, 100, 1) var max_health: int = 20
|
||||
@export_range(0, 100, 1) var attack_damage: int = 1
|
||||
|
||||
## Minimum time between the beginning of two attacks.
|
||||
@@ -44,11 +45,11 @@ enum AttackState {
|
||||
## Horizontal distance at which the Walker stops chasing and prepares a hit.
|
||||
## This is intentionally wider than the final hitbox so entering range does not
|
||||
## mean taking unavoidable damage.
|
||||
@export var attack_trigger_distance: float = 125.0
|
||||
@export var attack_trigger_distance: float = 140.0
|
||||
|
||||
## Keeps the Walker from starting a ground attack against a player far above or
|
||||
## below it.
|
||||
@export var attack_vertical_tolerance: float = 70.0
|
||||
@export var attack_vertical_tolerance: float = 80.0
|
||||
|
||||
## Readable pause before the dangerous part of the attack starts. During this
|
||||
## time the direction is locked, so moving behind the enemy is a valid dodge.
|
||||
@@ -57,29 +58,63 @@ enum AttackState {
|
||||
## Duration of the actual hit. The hitbox sweeps forward during this window.
|
||||
@export var attack_duration: float = 0.22
|
||||
|
||||
## Small recovery after the hit before the enemy can move again.
|
||||
## Small recovery after the hit before the enemy can hitbox again.
|
||||
@export var attack_recovery_duration: float = 0.30
|
||||
|
||||
## Where the hitbox starts, relative to the enemy while facing right.
|
||||
@export var attack_start_offset: Vector2 = Vector2(34.0, 0.0)
|
||||
|
||||
## Furthest horizontal position reached by the moving hitbox.
|
||||
@export var attack_reach: float = 105.0
|
||||
@export var attack_reach: float = 120.0
|
||||
|
||||
## A successful player hit briefly interrupts the Walker. This makes attacking
|
||||
## during its windup useful instead of forcing an unavoidable damage trade.
|
||||
@export var hit_stun_duration: float = 0.18
|
||||
|
||||
## Strength of the knockback applied per point of damage. The final push is
|
||||
## divided by the enemy's max health, so tougher enemies move less.
|
||||
@export var knockback_strength: float = 400.0
|
||||
|
||||
## How long the knockback impulse lasts before friction brings the enemy to a halt.
|
||||
@export var knockback_duration: float = 0.4
|
||||
|
||||
## Damage threshold to trigger a longer stun (e.g. a fully charged special attack).
|
||||
@export_range(0, 100, 1) var stun_damage_threshold: int = 5
|
||||
|
||||
## Stun duration when the received damage exceeds the threshold.
|
||||
@export var strong_hit_stun_duration: float = 2.0
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# RESPAWN
|
||||
# ============================================================================
|
||||
|
||||
@export_category("Drops")
|
||||
|
||||
## Default weighted drops for normal encounters.
|
||||
@export var drop_table: PickupDropTable
|
||||
|
||||
## Optional fixed drop, used by the Level 01 test route. When assigned, this
|
||||
## object drops with 100% probability INSTEAD of the random table.
|
||||
@export var guaranteed_drop: PickupData
|
||||
|
||||
## In the Android lab, Level01 watches deaths and spawns the fixed reward.
|
||||
## Other levels keep using this enemy's own random/guaranteed drop logic.
|
||||
var drops_handled_by_level: bool = false
|
||||
|
||||
|
||||
@export_category("Respawn")
|
||||
|
||||
## Enough downtime to make defeating an enemy meaningful before it comes back.
|
||||
## A value of 0 disables respawn (one enemy = one test item).
|
||||
@export var respawn_delay: float = 5.0
|
||||
|
||||
## Limits how far the enemy may chase from its spawn point; 0 = unrestricted.
|
||||
## Small limits keep independent testing encounters from piling up.
|
||||
@export var chase_radius: float = 0.0
|
||||
|
||||
## Only used to describe enemy variants in test HUDs.
|
||||
@export var enemy_display_name: String = "Walker"
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# DEBUG
|
||||
@@ -92,6 +127,10 @@ enum AttackState {
|
||||
## The orange area during windup previews the complete attack sweep.
|
||||
@export var show_debug_hitboxes: bool = true
|
||||
|
||||
## Shows the enemy health bar above its head and floating damage numbers when
|
||||
## it is hit. Purely debug: can be disabled once final art and UI exist.
|
||||
@export var show_debug_enemy_info: bool = true
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# NODES
|
||||
@@ -103,6 +142,7 @@ enum AttackState {
|
||||
@onready var attack_collision: CollisionShape2D = $AttackHitbox/CollisionShape2D
|
||||
@onready var floor_probe: RayCast2D = $FloorProbe
|
||||
@onready var visibility_notifier: VisibleOnScreenNotifier2D = $VisibleOnScreenNotifier2D
|
||||
@onready var visual: Sprite2D = $Visual
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -127,6 +167,13 @@ var target: Node2D
|
||||
## Prevents one sweep from damaging the same target once per physics frame.
|
||||
var attack_hit_targets: Dictionary = {}
|
||||
|
||||
## Timer for the knockback impulse applied when the enemy is hit.
|
||||
var knockback_timer: float = 0.0
|
||||
|
||||
## Floating damage numbers shown above the enemy when it takes damage.
|
||||
## Each entry: { text: String, local_pos: Vector2, timer: float }
|
||||
var _damage_texts: Array = []
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
spawn_position = global_position
|
||||
@@ -137,6 +184,11 @@ func _ready() -> void:
|
||||
attack_hitbox.collision_mask = PLAYER_HURTBOX_MASK
|
||||
attack_hitbox.monitoring = true
|
||||
|
||||
if drop_table == null:
|
||||
var default_table := load("res://enemies/walker/walker_drop.tres")
|
||||
if default_table != null:
|
||||
drop_table = default_table
|
||||
|
||||
visibility_notifier.screen_entered.connect(_wake_up)
|
||||
|
||||
_update_facing()
|
||||
@@ -149,6 +201,7 @@ func _physics_process(delta: float) -> void:
|
||||
return
|
||||
|
||||
_update_timers(delta)
|
||||
_update_damage_texts(delta)
|
||||
_apply_gravity(delta)
|
||||
|
||||
# The enemy deliberately does nothing until the camera has shown it once.
|
||||
@@ -167,11 +220,18 @@ func _physics_process(delta: float) -> void:
|
||||
queue_redraw()
|
||||
return
|
||||
|
||||
# Being hit pauses both movement and attack for only a few frames. The
|
||||
# Being hit pauses both movement and attack. While the knockback impulse
|
||||
# lasts the enemy is pushed back, then friction brings it to a halt. The
|
||||
# cooldown keeps running, so interrupting an attack does not make the enemy
|
||||
# immediately start another one.
|
||||
if hit_stun_timer > 0.0:
|
||||
velocity.x = 0.0
|
||||
if knockback_timer > 0.0:
|
||||
knockback_timer = max(knockback_timer - delta, 0.0)
|
||||
var fade: float = knockback_timer / knockback_duration if knockback_duration > 0.0 else 0.0
|
||||
velocity.x = move_toward(velocity.x, 0.0, knockback_strength * delta * (1.0 - fade + 0.1))
|
||||
else:
|
||||
velocity.x = move_toward(velocity.x, 0.0, knockback_strength * delta)
|
||||
|
||||
move_and_slide()
|
||||
queue_redraw()
|
||||
return
|
||||
@@ -216,6 +276,8 @@ func _update_facing() -> void:
|
||||
|
||||
if attack_state == AttackState.IDLE:
|
||||
_reset_attack_hitbox_position()
|
||||
# The five variants share one collision box and AI, but use different sprites.
|
||||
visual.flip_h = facing_direction < 0.0
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -241,6 +303,13 @@ func _update_idle_behaviour() -> void:
|
||||
|
||||
|
||||
func _chase_target() -> void:
|
||||
# Limit chasing to the current testing station when chase_radius is set.
|
||||
# Going back towards the spawn point is always allowed.
|
||||
var distance_from_spawn: float = global_position.x - spawn_position.x
|
||||
if chase_radius > 0.0 and absf(distance_from_spawn) >= chase_radius and signf(distance_from_spawn) == facing_direction:
|
||||
velocity.x = 0.0
|
||||
return
|
||||
|
||||
# Do not blindly walk off a platform while chasing. Proper pathfinding is
|
||||
# intentionally postponed until levels actually require it.
|
||||
if is_on_floor() and not floor_probe.is_colliding():
|
||||
@@ -378,6 +447,15 @@ func _update_timers(delta: float) -> void:
|
||||
hit_stun_timer = max(hit_stun_timer - delta, 0.0)
|
||||
|
||||
|
||||
# Updates floating damage numbers: they drift upward and fade out over time.
|
||||
func _update_damage_texts(delta: float) -> void:
|
||||
for i in range(_damage_texts.size() - 1, -1, -1):
|
||||
var entry: Dictionary = _damage_texts[i]
|
||||
entry.timer = max(entry.timer - delta, 0.0)
|
||||
entry.local_pos.y -= 40.0 * delta
|
||||
if entry.timer <= 0.0:
|
||||
_damage_texts.remove_at(i)
|
||||
|
||||
# ============================================================================
|
||||
# DAMAGE AND RESPAWN
|
||||
# ============================================================================
|
||||
@@ -388,6 +466,14 @@ func take_damage(amount: int, source_position: Vector2) -> void:
|
||||
|
||||
current_health = max(current_health - amount, 0)
|
||||
|
||||
# Floating damage number (debug only).
|
||||
if show_debug_enemy_info:
|
||||
_damage_texts.append({
|
||||
"text": str(amount),
|
||||
"local_pos": Vector2(0, -25),
|
||||
"timer": 1.0
|
||||
})
|
||||
|
||||
if current_health == 0:
|
||||
_die()
|
||||
return
|
||||
@@ -395,8 +481,25 @@ func take_damage(amount: int, source_position: Vector2) -> void:
|
||||
# Light enemies are interruptible. This makes a well-timed player attack a
|
||||
# defensive option and avoids mandatory damage trades at close range.
|
||||
_interrupt_attack()
|
||||
hit_stun_timer = hit_stun_duration
|
||||
velocity.x = 0.0
|
||||
|
||||
# Knockback: stronger hits push harder, tougher enemies (more max health)
|
||||
# resist the push. Direction is away from the damage source.
|
||||
var knockback_dir: float = signf(global_position.x - source_position.x)
|
||||
if knockback_dir == 0.0:
|
||||
knockback_dir = 1.0
|
||||
|
||||
var knockback_force: float = float(amount) * knockback_strength / float(max_health)
|
||||
velocity.x = knockback_dir * knockback_force
|
||||
velocity.y = -180.0
|
||||
|
||||
knockback_timer = knockback_duration
|
||||
|
||||
# Stun: normal hits use the brief hit stun; very strong hits (e.g. a fully
|
||||
# charged special attack) trigger a longer stun.
|
||||
if amount >= stun_damage_threshold:
|
||||
hit_stun_timer = max(hit_stun_timer, strong_hit_stun_duration)
|
||||
else:
|
||||
hit_stun_timer = max(hit_stun_timer, hit_stun_duration)
|
||||
|
||||
var reaction_direction: float = signf(source_position.x - global_position.x)
|
||||
if reaction_direction != 0.0:
|
||||
@@ -408,6 +511,20 @@ func _die() -> void:
|
||||
is_dead = true
|
||||
died.emit()
|
||||
|
||||
# Test encounters always drop their assigned item, including the two items
|
||||
# absent from the normal Walker table. Other levels keep their random loot.
|
||||
var drops: Array[PickupData] = []
|
||||
if not drops_handled_by_level:
|
||||
if guaranteed_drop != null:
|
||||
drops.append(guaranteed_drop)
|
||||
elif drop_table != null:
|
||||
drops = DROP_MANAGER.roll_drop(drop_table)
|
||||
if not drops.is_empty():
|
||||
var parent: Node = get_tree().current_scene
|
||||
if parent == null:
|
||||
parent = get_tree().root
|
||||
DROP_MANAGER.spawn_drops(drops, parent, global_position)
|
||||
|
||||
velocity = Vector2.ZERO
|
||||
visible = false
|
||||
|
||||
@@ -417,8 +534,9 @@ func _die() -> void:
|
||||
hurtbox_collision.set_deferred("disabled", true)
|
||||
attack_collision.set_deferred("disabled", true)
|
||||
|
||||
await get_tree().create_timer(respawn_delay).timeout
|
||||
_respawn()
|
||||
if respawn_delay > 0.0:
|
||||
await get_tree().create_timer(respawn_delay).timeout
|
||||
_respawn()
|
||||
|
||||
|
||||
func _respawn() -> void:
|
||||
@@ -430,6 +548,7 @@ func _respawn() -> void:
|
||||
attack_phase_timer = 0.0
|
||||
attack_cooldown_timer = 0.0
|
||||
hit_stun_timer = 0.0
|
||||
knockback_timer = 0.0
|
||||
attack_hit_targets.clear()
|
||||
attack_direction = facing_direction
|
||||
_reset_attack_hitbox_position()
|
||||
@@ -452,13 +571,23 @@ func _respawn() -> void:
|
||||
# ============================================================================
|
||||
|
||||
func _draw() -> void:
|
||||
# The enemy has no sprite yet. This neutral block makes the actual entity
|
||||
# visible independently from the debug overlays.
|
||||
_draw_rectangle_collision(
|
||||
body_collision,
|
||||
Color(0.18, 0.18, 0.20, 0.90),
|
||||
Color(0.85, 0.85, 0.90, 1.0)
|
||||
)
|
||||
# Retain a fallback body if an imported sprite is missing.
|
||||
if visual.texture == null:
|
||||
_draw_rectangle_collision(
|
||||
body_collision,
|
||||
Color(0.18, 0.18, 0.20, 0.90),
|
||||
Color(0.85, 0.85, 0.90, 1.0)
|
||||
)
|
||||
|
||||
# Enemy health bar and floating damage numbers (debug overlay).
|
||||
if show_debug_enemy_info:
|
||||
_draw_enemy_health_bar()
|
||||
_draw_damage_texts()
|
||||
|
||||
# Orange windup is important gameplay feedback, not a debug hitbox.
|
||||
# Keep it visible on Android even when red collision overlays are disabled.
|
||||
if attack_state == AttackState.WINDUP:
|
||||
_draw_attack_telegraph()
|
||||
|
||||
if not show_debug_hitboxes:
|
||||
return
|
||||
@@ -470,11 +599,6 @@ func _draw() -> void:
|
||||
Color(1.0, 0.05, 0.05, 0.55)
|
||||
)
|
||||
|
||||
# Windup: preview the full sweep in orange. It is explicitly NOT dangerous
|
||||
# yet, so the different colour makes the reaction window easy to understand.
|
||||
if attack_state == AttackState.WINDUP:
|
||||
_draw_attack_telegraph()
|
||||
|
||||
# Active attack: draw the real moving physics hitbox in strong red.
|
||||
if attack_state == AttackState.ACTIVE:
|
||||
_draw_rectangle_collision(
|
||||
@@ -516,3 +640,31 @@ func _draw_rectangle_collision(
|
||||
var rect: Rect2 = Rect2(center - rectangle.size / 2.0, rectangle.size)
|
||||
draw_rect(rect, fill_color, true)
|
||||
draw_rect(rect, outline_color, false, 2.0)
|
||||
|
||||
# Draws a small horizontal health bar just above the enemy's head.
|
||||
func _draw_enemy_health_bar() -> void:
|
||||
var bar_width: float = 40.0
|
||||
var bar_height: float = 5.0
|
||||
var bar_pos: Vector2 = Vector2(-bar_width * 0.5, -48.0)
|
||||
|
||||
# Background.
|
||||
draw_rect(Rect2(bar_pos, Vector2(bar_width, bar_height)), Color(0.2, 0.2, 0.2, 0.8), true)
|
||||
# Fill.
|
||||
var fill_ratio: float = current_health / max_health if max_health > 0 else 0.0
|
||||
draw_rect(
|
||||
Rect2(bar_pos, Vector2(bar_width * fill_ratio, bar_height)),
|
||||
Color(0.85, 0.2, 0.2, 0.95),
|
||||
true
|
||||
)
|
||||
# Border.
|
||||
draw_rect(Rect2(bar_pos, Vector2(bar_width, bar_height)), Color(1, 1, 1, 0.6), false, 1.0)
|
||||
|
||||
# Draws floating damage numbers that drift upward and fade out.
|
||||
func _draw_damage_texts() -> void:
|
||||
var font: Font = ThemeDB.get_default_theme().get_font("font", "Label")
|
||||
if font == null:
|
||||
return
|
||||
|
||||
for entry in _damage_texts:
|
||||
var alpha: float = clamp(entry.timer, 0.0, 1.0)
|
||||
draw_string(font, entry.local_pos, entry.text, 0, -1, 16, Color(1, 1, 1, alpha))
|
||||
@@ -1,18 +1,24 @@
|
||||
[gd_scene load_steps=4 format=3]
|
||||
[gd_scene load_steps=5 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://enemies/walker/walker.gd" id="1_walker"]
|
||||
[ext_resource type="Texture2D" path="res://assets/enemies/roadie.svg" id="2_sprite"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="BodyShape"]
|
||||
size = Vector2(42, 78)
|
||||
size = Vector2(28, 52)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="AttackShape"]
|
||||
size = Vector2(50, 60)
|
||||
size = Vector2(32, 40)
|
||||
|
||||
[node name="Walker" type="CharacterBody2D"]
|
||||
[node name="Walker" type="CharacterBody2D" groups=["enemy"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 1
|
||||
script = ExtResource("1_walker")
|
||||
|
||||
[node name="Visual" type="Sprite2D" parent="."]
|
||||
z_index = -1
|
||||
texture_filter = 1
|
||||
texture = ExtResource("2_sprite")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0, 0)
|
||||
shape = SubResource("BodyShape")
|
||||
@@ -36,10 +42,10 @@ monitorable = false
|
||||
shape = SubResource("AttackShape")
|
||||
|
||||
[node name="FloorProbe" type="RayCast2D" parent="."]
|
||||
position = Vector2(24, 34)
|
||||
target_position = Vector2(0, 34)
|
||||
position = Vector2(17, 24)
|
||||
target_position = Vector2(0, 24)
|
||||
collision_mask = 1
|
||||
enabled = true
|
||||
|
||||
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||
rect = Rect2(-32, -48, 64, 96)
|
||||
rect = Rect2(-17, -25, 34, 50)
|
||||
@@ -0,0 +1,101 @@
|
||||
[gd_resource type="Resource" script_class="PickupDropTable" load_steps=33 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_drop.gd" id="1_drop"]
|
||||
[ext_resource type="Script" path="res://pickups/pickup_drop_table.gd" id="2_table"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/beer.tres" id="item_0"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/coffee.tres" id="item_1"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/bocata_roadie.tres" id="item_2"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pizza_post_bolo.tres" id="item_3"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/tupper_bateria.tres" id="item_4"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/lata_feedback.tres" id="item_5"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/botas_doble_bombo.tres" id="item_6"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pua_apocalipsis.tres" id="item_7"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pedal_distorsion.tres" id="item_8"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/cuerda_titanio.tres" id="item_9"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/casete_demo.tres" id="item_10"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/setlist_fin.tres" id="item_11"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/amplificador_11.tres" id="item_12"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/cinta_americana.tres" id="item_13"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/tapones_tecnico.tres" id="item_14"]
|
||||
|
||||
[sub_resource type="Resource" id="drop_0"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_0")
|
||||
weight = 15.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_1"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_1")
|
||||
weight = 10.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_2"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_2")
|
||||
weight = 14.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_3"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_3")
|
||||
weight = 9.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_4"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_4")
|
||||
weight = 2.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_5"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_5")
|
||||
weight = 10.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_6"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_6")
|
||||
weight = 5.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_7"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_7")
|
||||
weight = 8.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_8"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_8")
|
||||
weight = 3.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_9"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_9")
|
||||
weight = 5.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_10"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_10")
|
||||
weight = 8.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_11"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_11")
|
||||
weight = 4.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_12"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_12")
|
||||
weight = 1.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_13"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_13")
|
||||
weight = 3.0
|
||||
|
||||
[sub_resource type="Resource" id="drop_14"]
|
||||
script = ExtResource("1_drop")
|
||||
pickup = ExtResource("item_14")
|
||||
weight = 3.0
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_table")
|
||||
drops = Array[ExtResource("1_drop")]([SubResource("drop_0"), SubResource("drop_1"), SubResource("drop_2"), SubResource("drop_3"), SubResource("drop_4"), SubResource("drop_5"), SubResource("drop_6"), SubResource("drop_7"), SubResource("drop_8"), SubResource("drop_9"), SubResource("drop_10"), SubResource("drop_11"), SubResource("drop_12"), SubResource("drop_13"), SubResource("drop_14")])
|
||||
drop_chance = 0.5
|
||||
min_drops = 1
|
||||
max_drops = 1
|
||||
@@ -0,0 +1,169 @@
|
||||
extends Node2D
|
||||
|
||||
## Android test course: 17 stations / 17 different guaranteed items.
|
||||
## Encounters are configured in the scene, not spawned by code.
|
||||
## This laboratory intentionally owns fixed drops: each death is observed from
|
||||
## the actual is_dead state, even when a died signal is missed.
|
||||
|
||||
signal level_completed
|
||||
|
||||
const TEST_ITEM_COUNT: int = 17
|
||||
const LEVEL_WIDTH: int = 8500
|
||||
const FINISH_RESTART_SECONDS: float = 8.0
|
||||
const LAB_BUILD: String = "LAB DROPS v4"
|
||||
const CONTROL_ITEM_ID: StringName = &"lab_control"
|
||||
const PICKUP_SCENE: PackedScene = preload("res://pickups/pickup.tscn")
|
||||
|
||||
@onready var player: Node2D = $Player
|
||||
@onready var test_enemies: Node2D = $TestEnemies
|
||||
@onready var status_label: Label = $TestHUD/Overlay/Status
|
||||
@onready var finish_message: Label = $TestHUD/Overlay/FinishMessage
|
||||
|
||||
var collected_items: Dictionary = {} # PickupData.id -> true; count each only once
|
||||
var defeated_enemies: int = 0
|
||||
var death_signals: int = 0
|
||||
var spawned_drops: int = 0
|
||||
var _processed_deaths: Dictionary = {} # enemy instance id -> true
|
||||
var showing_victory: bool = false
|
||||
var victory_timer: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# These two markers distinguish an actually loaded script from an old APK.
|
||||
status_label.text = "%s: script iniciado" % LAB_BUILD
|
||||
print("%s: Level01 script iniciado" % LAB_BUILD)
|
||||
finish_message.visible = false
|
||||
# Player Camera2D sets its own provisional limit (4000) in _ready.
|
||||
# Override it here, after child _ready, for the long Android route.
|
||||
var camera: Camera2D = player.get_node("Camera2D") as Camera2D
|
||||
camera.limit_right = LEVEL_WIDTH
|
||||
|
||||
$FinishZone.body_entered.connect(_on_finish_entered)
|
||||
$DeathZone.body_entered.connect(_on_death_entered)
|
||||
player.connect(&"pickup_collected", _on_pickup_collected)
|
||||
for enemy in test_enemies.get_children():
|
||||
# The laboratory, not Walker, owns the fixed drop. Only this level sets
|
||||
# the flag: normal enemies still generate their usual random drops.
|
||||
enemy.set("drops_handled_by_level", true)
|
||||
if enemy.get("guaranteed_drop") == null:
|
||||
push_error("%s has no guaranteed_drop assigned." % enemy.name)
|
||||
if enemy.has_signal(&"died"):
|
||||
enemy.connect(&"died", _on_station_enemy_died)
|
||||
else:
|
||||
push_error("%s no expone la senal died" % enemy.name)
|
||||
_update_status()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
# Do not depend on the died signal to count KOs or create the object.
|
||||
# A transition to is_dead can only be processed once per enemy.
|
||||
_process_station_deaths()
|
||||
if showing_victory:
|
||||
victory_timer += delta
|
||||
if victory_timer >= FINISH_RESTART_SECONDS:
|
||||
get_tree().reload_current_scene()
|
||||
return
|
||||
|
||||
_update_status()
|
||||
|
||||
|
||||
func _update_status() -> void:
|
||||
# Each station has one enemy and an assigned pickup. Look ahead to the first
|
||||
# living enemy so the player knows what to expect without opening a menu.
|
||||
var next_item: String = "FIN DEL RECORRIDO"
|
||||
for enemy in test_enemies.get_children():
|
||||
if bool(enemy.get("is_dead")):
|
||||
continue
|
||||
var enemy_body: Node2D = enemy as Node2D
|
||||
if enemy_body.position.x < player.position.x - 165.0:
|
||||
continue
|
||||
var data: PickupData = enemy.get("guaranteed_drop") as PickupData
|
||||
if data != null:
|
||||
next_item = data.display_name
|
||||
break
|
||||
|
||||
# S is the number of died signals received. KOs come from is_dead,
|
||||
# not signals. A difference between them pinpoints a signal problem.
|
||||
var loose_drops: int = get_tree().get_nodes_in_group("pickup").size()
|
||||
status_label.text = "%s | %02d/%02d objetos\nKOs: %02d | Senales: %02d | Creados: %02d | Suelo: %02d\nSIGUIENTE: %s" % [
|
||||
LAB_BUILD, collected_items.size(), TEST_ITEM_COUNT,
|
||||
defeated_enemies, death_signals, spawned_drops, loose_drops, next_item
|
||||
]
|
||||
|
||||
|
||||
func _process_station_deaths() -> void:
|
||||
for enemy in test_enemies.get_children():
|
||||
if not bool(enemy.get("is_dead")):
|
||||
continue
|
||||
var instance_id: int = enemy.get_instance_id()
|
||||
if _processed_deaths.has(instance_id):
|
||||
continue
|
||||
_processed_deaths[instance_id] = true
|
||||
defeated_enemies += 1
|
||||
|
||||
var data: PickupData = enemy.get("guaranteed_drop") as PickupData
|
||||
if data == null:
|
||||
push_error("%s: %s ha muerto sin objeto asignado" % [LAB_BUILD, enemy.name])
|
||||
continue
|
||||
|
||||
# Adding an Area2D during a physics step is unsafe. Set position and
|
||||
# data before adding it, then defer its entry into the scene tree.
|
||||
var pickup: Pickup = PICKUP_SCENE.instantiate() as Pickup
|
||||
pickup.pickup_data = data
|
||||
pickup.collection_delay_seconds = Pickup.DROP_COLLECTION_DELAY_SECONDS
|
||||
pickup.position = to_local(enemy.global_position + Vector2(34.0, -12.0))
|
||||
call_deferred("add_child", pickup)
|
||||
spawned_drops += 1
|
||||
print("%s: KO %s -> %s" % [LAB_BUILD, enemy.name, data.display_name])
|
||||
|
||||
|
||||
func _on_station_enemy_died() -> void:
|
||||
# Diagnostic counter only; the actual reward is managed above.
|
||||
death_signals += 1
|
||||
|
||||
|
||||
func _on_pickup_collected(data: PickupData) -> void:
|
||||
# The extra pickup at the start checks rendering and collection independently
|
||||
# of enemy deaths. It is not one of the 17 rewards.
|
||||
if data.id == CONTROL_ITEM_ID:
|
||||
return
|
||||
# A heal at full HP or a charge item with a full meter isn't consumed and
|
||||
# doesn't count. The object remains on the floor for later collection.
|
||||
collected_items[data.id] = true
|
||||
_update_status()
|
||||
|
||||
|
||||
func _on_finish_entered(body: Node2D) -> void:
|
||||
if body != player or showing_victory:
|
||||
return
|
||||
showing_victory = true
|
||||
level_completed.emit()
|
||||
finish_message.text = "FIN DEL LAB!\nObjetos recogidos: %d / %d\nReinicio en 8 s" % [
|
||||
collected_items.size(), TEST_ITEM_COUNT
|
||||
]
|
||||
finish_message.visible = true
|
||||
|
||||
|
||||
func _on_death_entered(body: Node2D) -> void:
|
||||
if body == player and body.has_method("take_damage"):
|
||||
body.take_damage(9999, body.global_position)
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
# Temporary coloured geometry; collision shapes are the single source of
|
||||
# truth for position and dimensions, so the visuals cannot desynchronise.
|
||||
for child in $World.get_children():
|
||||
if not child is CollisionShape2D:
|
||||
continue
|
||||
var collision: CollisionShape2D = child as CollisionShape2D
|
||||
var rectangle: RectangleShape2D = collision.shape as RectangleShape2D
|
||||
if rectangle == null:
|
||||
continue
|
||||
var color: Color = Color(0.32, 0.57, 0.79)
|
||||
if collision.name == "Floor":
|
||||
color = Color(0.20, 0.40, 0.25)
|
||||
elif collision.name.begins_with("High"):
|
||||
color = Color(0.68, 0.39, 0.76)
|
||||
var rect: Rect2 = Rect2(collision.position - rectangle.size / 2.0, rectangle.size)
|
||||
draw_rect(rect, color, true)
|
||||
draw_rect(rect, Color(0.93, 0.94, 1.0, 0.6), false, 2.0)
|
||||
@@ -0,0 +1,459 @@
|
||||
[gd_scene load_steps=33 format=3]
|
||||
|
||||
[ext_resource type="PackedScene" path="res://player/player.tscn" id="1_player"]
|
||||
[ext_resource type="PackedScene" path="res://ui/mobile_controls/mobile_controls.tscn" id="2_mobile"]
|
||||
[ext_resource type="Script" path="res://levels/level_01.gd" id="3_level"]
|
||||
[ext_resource type="PackedScene" path="res://pickups/pickup.tscn" id="4_pickup"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/lab_control.tres" id="lab_control"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/roadie.tscn" id="v0"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/pogo_fan.tscn" id="v1"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/feedback_tech.tscn" id="v2"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/backstage_guard.tscn" id="v3"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/rival_guitarist.tscn" id="v4"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pua_apocalipsis.tres" id="item_0"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/beer.tres" id="item_1"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/coffee.tres" id="item_2"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/casete_demo.tres" id="item_3"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/bocata_roadie.tres" id="item_4"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/lata_feedback.tres" id="item_5"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pedal_distorsion.tres" id="item_6"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/setlist_fin.tres" id="item_7"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pizza_post_bolo.tres" id="item_8"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/cuerda_titanio.tres" id="item_9"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/cinta_americana.tres" id="item_10"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/tapones_tecnico.tres" id="item_11"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/tupper_bateria.tres" id="item_12"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/botas_doble_bombo.tres" id="item_13"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/muelles_stage.tres" id="item_14"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/baqueta_sismica.tres" id="item_15"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/amplificador_11.tres" id="item_16"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="FloorShape"]
|
||||
size = Vector2(8500, 40)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="StepShape"]
|
||||
size = Vector2(240, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="HighShape"]
|
||||
size = Vector2(180, 16)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="FinishShape"]
|
||||
size = Vector2(70, 200)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="DeathShape"]
|
||||
size = Vector2(9000, 170)
|
||||
|
||||
[node name="Level01" type="Node2D"]
|
||||
script = ExtResource("3_level")
|
||||
|
||||
[node name="World" type="StaticBody2D" parent="."]
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Floor" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(4250, 620)
|
||||
shape = SubResource("FloorShape")
|
||||
|
||||
[node name="Step1" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(1530, 455)
|
||||
shape = SubResource("StepShape")
|
||||
|
||||
[node name="High1" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(1690, 291)
|
||||
shape = SubResource("HighShape")
|
||||
|
||||
[node name="Step2" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(3370, 485)
|
||||
shape = SubResource("StepShape")
|
||||
|
||||
[node name="High2" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(3520, 338)
|
||||
shape = SubResource("HighShape")
|
||||
|
||||
[node name="Step3" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(5600, 455)
|
||||
shape = SubResource("StepShape")
|
||||
|
||||
[node name="High3" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(5750, 291)
|
||||
shape = SubResource("HighShape")
|
||||
|
||||
[node name="Step4" type="CollisionShape2D" parent="World"]
|
||||
position = Vector2(6890, 485)
|
||||
shape = SubResource("StepShape")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_player")]
|
||||
position = Vector2(140, 557)
|
||||
show_debug_hitboxes = false
|
||||
special_radius = 290.0
|
||||
|
||||
[node name="ControlPickup" parent="." instance=ExtResource("4_pickup")]
|
||||
position = Vector2(270, 548)
|
||||
pickup_data = ExtResource("lab_control")
|
||||
|
||||
[node name="ControlSign" type="Label" parent="."]
|
||||
offset_left = 173.0
|
||||
offset_top = 461.0
|
||||
offset_right = 368.0
|
||||
offset_bottom = 500.0
|
||||
text = "CONTROL: objeto SIN matar"
|
||||
horizontal_alignment = 1
|
||||
theme_override_font_sizes/font_size = 11
|
||||
|
||||
[node name="TestEnemies" type="Node2D" parent="."]
|
||||
|
||||
[node name="Station01" parent="TestEnemies" instance=ExtResource("v0")]
|
||||
position = Vector2(480, 555)
|
||||
guaranteed_drop = ExtResource("item_0")
|
||||
|
||||
[node name="Station02" parent="TestEnemies" instance=ExtResource("v1")]
|
||||
position = Vector2(930, 555)
|
||||
guaranteed_drop = ExtResource("item_1")
|
||||
|
||||
[node name="Station03" parent="TestEnemies" instance=ExtResource("v2")]
|
||||
position = Vector2(1380, 555)
|
||||
guaranteed_drop = ExtResource("item_2")
|
||||
|
||||
[node name="Station04" parent="TestEnemies" instance=ExtResource("v3")]
|
||||
position = Vector2(1830, 555)
|
||||
guaranteed_drop = ExtResource("item_3")
|
||||
|
||||
[node name="Station05" parent="TestEnemies" instance=ExtResource("v4")]
|
||||
position = Vector2(2280, 555)
|
||||
guaranteed_drop = ExtResource("item_4")
|
||||
|
||||
[node name="Station06" parent="TestEnemies" instance=ExtResource("v0")]
|
||||
position = Vector2(2730, 555)
|
||||
guaranteed_drop = ExtResource("item_5")
|
||||
|
||||
[node name="Station07" parent="TestEnemies" instance=ExtResource("v1")]
|
||||
position = Vector2(3180, 555)
|
||||
guaranteed_drop = ExtResource("item_6")
|
||||
|
||||
[node name="Station08" parent="TestEnemies" instance=ExtResource("v2")]
|
||||
position = Vector2(3630, 555)
|
||||
guaranteed_drop = ExtResource("item_7")
|
||||
|
||||
[node name="Station09" parent="TestEnemies" instance=ExtResource("v3")]
|
||||
position = Vector2(4080, 555)
|
||||
guaranteed_drop = ExtResource("item_8")
|
||||
|
||||
[node name="Station10" parent="TestEnemies" instance=ExtResource("v4")]
|
||||
position = Vector2(4530, 555)
|
||||
guaranteed_drop = ExtResource("item_9")
|
||||
|
||||
[node name="Station11" parent="TestEnemies" instance=ExtResource("v0")]
|
||||
position = Vector2(4980, 555)
|
||||
guaranteed_drop = ExtResource("item_10")
|
||||
|
||||
[node name="Station12" parent="TestEnemies" instance=ExtResource("v1")]
|
||||
position = Vector2(5430, 555)
|
||||
guaranteed_drop = ExtResource("item_11")
|
||||
|
||||
[node name="Station13" parent="TestEnemies" instance=ExtResource("v2")]
|
||||
position = Vector2(5880, 555)
|
||||
guaranteed_drop = ExtResource("item_12")
|
||||
|
||||
[node name="Station14" parent="TestEnemies" instance=ExtResource("v3")]
|
||||
position = Vector2(6330, 555)
|
||||
guaranteed_drop = ExtResource("item_13")
|
||||
|
||||
[node name="Station15" parent="TestEnemies" instance=ExtResource("v4")]
|
||||
position = Vector2(6780, 555)
|
||||
guaranteed_drop = ExtResource("item_14")
|
||||
|
||||
[node name="Station16" parent="TestEnemies" instance=ExtResource("v0")]
|
||||
position = Vector2(7230, 555)
|
||||
guaranteed_drop = ExtResource("item_15")
|
||||
|
||||
[node name="Station17" parent="TestEnemies" instance=ExtResource("v1")]
|
||||
position = Vector2(7680, 555)
|
||||
guaranteed_drop = ExtResource("item_16")
|
||||
|
||||
[node name="StationSigns" type="Node2D" parent="."]
|
||||
|
||||
[node name="Sign01" type="Label" parent="StationSigns"]
|
||||
offset_left = 269.0
|
||||
offset_top = 467.0
|
||||
offset_right = 691.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "01 Roadie del Mas Alla\n>> Pua del Apocalipsis"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign02" type="Label" parent="StationSigns"]
|
||||
offset_left = 719.0
|
||||
offset_top = 467.0
|
||||
offset_right = 1141.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "02 Fan del Pogo Eterno\n>> Espuma del Pogo"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign03" type="Label" parent="StationSigns"]
|
||||
offset_left = 1169.0
|
||||
offset_top = 467.0
|
||||
offset_right = 1591.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "03 Tecnico del Feedback\n>> Tostado del Averno"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign04" type="Label" parent="StationSigns"]
|
||||
offset_left = 1619.0
|
||||
offset_top = 467.0
|
||||
offset_right = 2041.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "04 Guardia del Camerino\n>> Casete de la Demo Perdida"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign05" type="Label" parent="StationSigns"]
|
||||
offset_left = 2069.0
|
||||
offset_top = 467.0
|
||||
offset_right = 2491.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "05 Guitarrista Rival\n>> Bocata del Roadie"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign06" type="Label" parent="StationSigns"]
|
||||
offset_left = 2519.0
|
||||
offset_top = 467.0
|
||||
offset_right = 2941.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "06 Roadie del Mas Alla\n>> Lata de Feedback"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign07" type="Label" parent="StationSigns"]
|
||||
offset_left = 2969.0
|
||||
offset_top = 467.0
|
||||
offset_right = 3391.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "07 Fan del Pogo Eterno\n>> Pedal de Distorsion"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign08" type="Label" parent="StationSigns"]
|
||||
offset_left = 3419.0
|
||||
offset_top = 467.0
|
||||
offset_right = 3841.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "08 Tecnico del Feedback\n>> Setlist del Fin del Mundo"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign09" type="Label" parent="StationSigns"]
|
||||
offset_left = 3869.0
|
||||
offset_top = 467.0
|
||||
offset_right = 4291.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "09 Guardia del Camerino\n>> Pizza Post-Bolo"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign10" type="Label" parent="StationSigns"]
|
||||
offset_left = 4319.0
|
||||
offset_top = 467.0
|
||||
offset_right = 4741.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "10 Guitarrista Rival\n>> Cuerda de Titanio"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign11" type="Label" parent="StationSigns"]
|
||||
offset_left = 4769.0
|
||||
offset_top = 467.0
|
||||
offset_right = 5191.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "11 Roadie del Mas Alla\n>> Cinta Americana Infinita"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign12" type="Label" parent="StationSigns"]
|
||||
offset_left = 5219.0
|
||||
offset_top = 467.0
|
||||
offset_right = 5641.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "12 Fan del Pogo Eterno\n>> Tapones del Tecnico"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign13" type="Label" parent="StationSigns"]
|
||||
offset_left = 5669.0
|
||||
offset_top = 467.0
|
||||
offset_right = 6091.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "13 Tecnico del Feedback\n>> Tupper del Bateria"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign14" type="Label" parent="StationSigns"]
|
||||
offset_left = 6119.0
|
||||
offset_top = 467.0
|
||||
offset_right = 6541.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "14 Guardia del Camerino\n>> Botas del Doble Bombo"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign15" type="Label" parent="StationSigns"]
|
||||
offset_left = 6569.0
|
||||
offset_top = 467.0
|
||||
offset_right = 6991.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "15 Guitarrista Rival\n>> Muelles del Stage Diving"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign16" type="Label" parent="StationSigns"]
|
||||
offset_left = 7019.0
|
||||
offset_top = 467.0
|
||||
offset_right = 7441.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "16 Roadie del Mas Alla\n>> Baqueta Sismica"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="Sign17" type="Label" parent="StationSigns"]
|
||||
offset_left = 7469.0
|
||||
offset_top = 467.0
|
||||
offset_right = 7891.0
|
||||
offset_bottom = 515.0
|
||||
theme_override_colors/font_color = Color(0.98, 0.92, 0.72, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.04, 0.03, 0.08, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 11
|
||||
text = "17 Fan del Pogo Eterno\n>> Amplificador al 11"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="FinishZone" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
position = Vector2(8180, 535)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="FinishZone"]
|
||||
shape = SubResource("FinishShape")
|
||||
|
||||
[node name="DeathZone" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
position = Vector2(4250, 770)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="DeathZone"]
|
||||
shape = SubResource("DeathShape")
|
||||
|
||||
[node name="TestHUD" type="CanvasLayer" parent="."]
|
||||
layer = 87
|
||||
|
||||
[node name="Overlay" type="Control" parent="TestHUD"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Status" type="Label" parent="TestHUD/Overlay"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -500.0
|
||||
offset_top = 16.0
|
||||
offset_right = -20.0
|
||||
offset_bottom = 104.0
|
||||
grow_horizontal = 0
|
||||
theme_override_colors/font_color = Color(1, 0.93, 0.68, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.02, 0.02, 0.02, 0.95)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
theme_override_font_sizes/font_size = 17
|
||||
text = "LAB DROPS v4: script SIN iniciar"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="FinishMessage" type="Label" parent="TestHUD/Overlay"]
|
||||
layout_mode = 1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.32
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.32
|
||||
offset_left = -330.0
|
||||
offset_top = -35.0
|
||||
offset_right = 330.0
|
||||
offset_bottom = 95.0
|
||||
theme_override_colors/font_color = Color(1, 0.90, 0.32, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
visible = false
|
||||
|
||||
[node name="MobileControls" parent="." instance=ExtResource("2_mobile")]
|
||||
@@ -0,0 +1,102 @@
|
||||
extends Node2D
|
||||
|
||||
## Alpha de campo: recorrido urbano con suelo a distintas alturas, plataformas,
|
||||
## grupos de enemigos y objetos opcionales. Las posiciones y colisiones se editan
|
||||
## en level_02.tscn; este script solo dibuja las superficies y gestiona la meta.
|
||||
## No interviene en los drops: los Walker usan su sistema habitual.
|
||||
|
||||
signal level_completed
|
||||
|
||||
const WORLD_WIDTH: int = 11000
|
||||
const FINISH_RESTART_SECONDS: float = 9.0
|
||||
|
||||
# El dibujo utiliza directamente los CollisionShape2D del escenario. Así no
|
||||
# hay una segunda lista de coordenadas visuales que pueda desincronizarse.
|
||||
const ASPHALT: Texture2D = preload("res://assets/city/asphalt.png")
|
||||
const CURB: Texture2D = preload("res://assets/city/curb.png")
|
||||
const WALKWAY: Texture2D = preload("res://assets/city/walkway.png")
|
||||
const BARRIER: Texture2D = preload("res://assets/city/barrier.png")
|
||||
|
||||
@onready var player: CharacterBody2D = $Player
|
||||
@onready var enemies: Node2D = $Enemies
|
||||
@onready var status_label: Label = $LevelHUD/Overlay/Status
|
||||
@onready var finish_message: Label = $LevelHUD/Overlay/FinishMessage
|
||||
|
||||
var defeated_enemies: int = 0
|
||||
var completed: bool = false
|
||||
var _finish_timer: float = 0.0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
# Camera2D configura un límite provisional de 4000 en su propio _ready().
|
||||
# El nivel lo sustituye después de que el jugador haya entrado en el árbol.
|
||||
var camera: Camera2D = player.get_node("Camera2D") as Camera2D
|
||||
camera.limit_left = 0
|
||||
camera.limit_top = 0
|
||||
camera.limit_right = WORLD_WIDTH
|
||||
camera.limit_bottom = 1280
|
||||
|
||||
$FinishZone.body_entered.connect(_on_finish_entered)
|
||||
finish_message.visible = false
|
||||
for enemy: Node in enemies.get_children():
|
||||
if enemy.has_signal(&"died"):
|
||||
enemy.connect(&"died", _on_enemy_died)
|
||||
_update_status()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
if completed:
|
||||
_finish_timer += delta
|
||||
if _finish_timer >= FINISH_RESTART_SECONDS:
|
||||
get_tree().reload_current_scene()
|
||||
return
|
||||
_update_status()
|
||||
|
||||
|
||||
func _on_enemy_died() -> void:
|
||||
defeated_enemies += 1
|
||||
|
||||
|
||||
func _update_status() -> void:
|
||||
var sector: int = clampi(int(player.global_position.x / (WORLD_WIDTH / 8.0)) + 1, 1, 8)
|
||||
status_label.text = "CALLE DEL FEEDBACK %02d/08\nKOs: %02d/%02d" % [
|
||||
sector, defeated_enemies, enemies.get_child_count()
|
||||
]
|
||||
|
||||
|
||||
func _on_finish_entered(body: Node2D) -> void:
|
||||
if body != player or completed:
|
||||
return
|
||||
completed = true
|
||||
level_completed.emit()
|
||||
finish_message.text = "FIN DE LA GIRA!\nEnemigos derrotados: %d / %d\nReinicio en 9 s" % [
|
||||
defeated_enemies, enemies.get_child_count()
|
||||
]
|
||||
finish_message.visible = true
|
||||
|
||||
|
||||
func _draw() -> void:
|
||||
# Tiling GPU: dos pequeños PNG para miles de unidades de calle.
|
||||
for collision: CollisionShape2D in $World/Ground.get_children():
|
||||
var bounds: Rect2 = _collision_rect(collision)
|
||||
if bounds.has_area():
|
||||
draw_texture_rect(ASPHALT, bounds, true)
|
||||
draw_texture_rect(CURB, Rect2(bounds.position.x, bounds.position.y, bounds.size.x, 24), true)
|
||||
|
||||
# Plataformas de una sola dirección: se atraviesan desde abajo, se aterriza
|
||||
# sobre ellas desde arriba y un segundo salto abre rutas opcionales.
|
||||
for collision: CollisionShape2D in $World/Walkways.get_children():
|
||||
var bounds: Rect2 = _collision_rect(collision)
|
||||
if bounds.has_area():
|
||||
draw_texture_rect(WALKWAY, bounds, true)
|
||||
|
||||
# Barreras visibles y sólidas; el jugador no puede abandonar el mapa.
|
||||
for wall_x: float in [0.0, WORLD_WIDTH - 48.0]:
|
||||
draw_texture_rect(BARRIER, Rect2(wall_x, 280.0, 48.0, 820.0), true)
|
||||
|
||||
|
||||
func _collision_rect(collision: CollisionShape2D) -> Rect2:
|
||||
var shape: RectangleShape2D = collision.shape as RectangleShape2D
|
||||
if shape == null:
|
||||
return Rect2()
|
||||
return Rect2(collision.position - shape.size * 0.5, shape.size)
|
||||
@@ -0,0 +1,904 @@
|
||||
[gd_scene load_steps=57 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://levels/level_02.gd" id="script"]
|
||||
[ext_resource type="PackedScene" path="res://player/player.tscn" id="player"]
|
||||
[ext_resource type="PackedScene" path="res://ui/mobile_controls/mobile_controls.tscn" id="mobile"]
|
||||
[ext_resource type="PackedScene" path="res://pickups/pickup.tscn" id="pickup"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/roadie.tscn" id="enemy_roadie"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/pogo_fan.tscn" id="enemy_pogo_fan"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/feedback_tech.tscn" id="enemy_feedback_tech"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/backstage_guard.tscn" id="enemy_backstage_guard"]
|
||||
[ext_resource type="PackedScene" path="res://enemies/variants/rival_guitarist.tscn" id="enemy_rival_guitarist"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/sky.png" id="art_sky"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/clouds.png" id="art_clouds"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/skyline_far.png" id="art_skyline_far"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/skyline_mid.png" id="art_skyline_mid"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/streetlamp.png" id="art_streetlamp"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_01.png" id="facade_01"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_02.png" id="facade_02"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_03.png" id="facade_03"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_04.png" id="facade_04"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_05.png" id="facade_05"]
|
||||
[ext_resource type="Texture2D" path="res://assets/city/facade_06.png" id="facade_06"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/amplificador_11.tres" id="item_amplificador_11"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/baqueta_sismica.tres" id="item_baqueta_sismica"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/beer.tres" id="item_beer"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/bocata_roadie.tres" id="item_bocata_roadie"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/botas_doble_bombo.tres" id="item_botas_doble_bombo"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/casete_demo.tres" id="item_casete_demo"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/cinta_americana.tres" id="item_cinta_americana"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/coffee.tres" id="item_coffee"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/muelles_stage.tres" id="item_muelles_stage"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pedal_distorsion.tres" id="item_pedal_distorsion"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/pizza_post_bolo.tres" id="item_pizza_post_bolo"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/setlist_fin.tres" id="item_setlist_fin"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/tapones_tecnico.tres" id="item_tapones_tecnico"]
|
||||
[ext_resource type="Resource" path="res://pickups/data/tupper_bateria.tres" id="item_tupper_bateria"]
|
||||
[ext_resource type="FontFile" path="res://assets/fonts/PixelOperator8.ttf" id="font"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground01"]
|
||||
size = Vector2(1480, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground02"]
|
||||
size = Vector2(1330, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground03"]
|
||||
size = Vector2(1340, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground04"]
|
||||
size = Vector2(1350, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground05"]
|
||||
size = Vector2(1300, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground06"]
|
||||
size = Vector2(1280, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground07"]
|
||||
size = Vector2(1280, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Ground08"]
|
||||
size = Vector2(1640, 500)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway01"]
|
||||
size = Vector2(270, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway02"]
|
||||
size = Vector2(230, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway03"]
|
||||
size = Vector2(230, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway04"]
|
||||
size = Vector2(220, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway05"]
|
||||
size = Vector2(190, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway06"]
|
||||
size = Vector2(260, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway07"]
|
||||
size = Vector2(200, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway08"]
|
||||
size = Vector2(190, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway09"]
|
||||
size = Vector2(220, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway10"]
|
||||
size = Vector2(230, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="Walkway11"]
|
||||
size = Vector2(270, 20)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="BarrierShape"]
|
||||
size = Vector2(60, 920)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="FinishShape"]
|
||||
size = Vector2(110, 240)
|
||||
|
||||
[node name="Level02" type="Node2D" parent="."]
|
||||
script = ExtResource("script")
|
||||
texture_filter = 1
|
||||
texture_repeat = 2
|
||||
|
||||
[node name="Sky" type="Parallax2D" parent="."]
|
||||
z_index = -18
|
||||
scroll_scale = Vector2(0, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="Sky"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_sky")
|
||||
|
||||
[node name="HighClouds" type="Parallax2D" parent="."]
|
||||
z_index = -17
|
||||
scroll_scale = Vector2(0.12, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
autoscroll = Vector2(3, 0)
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="HighClouds"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_clouds")
|
||||
|
||||
[node name="FarBuildings" type="Parallax2D" parent="."]
|
||||
z_index = -16
|
||||
scroll_scale = Vector2(0.23, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="FarBuildings"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_skyline_far")
|
||||
|
||||
[node name="NearBuildings" type="Parallax2D" parent="."]
|
||||
z_index = -15
|
||||
scroll_scale = Vector2(0.46, 1)
|
||||
repeat_size = Vector2(1024, 0)
|
||||
repeat_times = 2
|
||||
|
||||
[node name="Strip" type="Sprite2D" parent="NearBuildings"]
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_skyline_mid")
|
||||
|
||||
[node name="Facades" type="Node2D" parent="."]
|
||||
z_index = -8
|
||||
|
||||
[node name="Facade01" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(35, 480)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_01")
|
||||
|
||||
[node name="Facade02" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(394, 556)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_02")
|
||||
|
||||
[node name="Facade03" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(705, 426)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_03")
|
||||
|
||||
[node name="Facade04" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(1016, 524)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_04")
|
||||
|
||||
[node name="Facade05" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(1327, 380)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_05")
|
||||
|
||||
[node name="Facade06" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(1686, 366)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_06")
|
||||
|
||||
[node name="Facade07" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(1997, 390)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_01")
|
||||
|
||||
[node name="Facade08" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(2308, 466)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_02")
|
||||
|
||||
[node name="Facade09" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(2619, 336)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_03")
|
||||
|
||||
[node name="Facade10" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(2978, 569)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_04")
|
||||
|
||||
[node name="Facade11" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(3289, 425)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_05")
|
||||
|
||||
[node name="Facade12" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(3600, 501)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_06")
|
||||
|
||||
[node name="Facade13" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(3911, 525)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_01")
|
||||
|
||||
[node name="Facade14" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(4222, 516)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_02")
|
||||
|
||||
[node name="Facade15" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(4581, 386)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_03")
|
||||
|
||||
[node name="Facade16" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(4892, 484)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_04")
|
||||
|
||||
[node name="Facade17" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(5203, 340)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_05")
|
||||
|
||||
[node name="Facade18" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(5514, 311)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_06")
|
||||
|
||||
[node name="Facade19" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(5873, 335)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_01")
|
||||
|
||||
[node name="Facade20" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(6184, 411)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_02")
|
||||
|
||||
[node name="Facade21" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(6495, 281)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_03")
|
||||
|
||||
[node name="Facade22" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(6806, 554)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_04")
|
||||
|
||||
[node name="Facade23" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(7165, 410)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_05")
|
||||
|
||||
[node name="Facade24" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(7476, 486)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_06")
|
||||
|
||||
[node name="Facade25" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(7787, 510)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_01")
|
||||
|
||||
[node name="Facade26" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(8098, 496)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_02")
|
||||
|
||||
[node name="Facade27" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(8409, 366)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_03")
|
||||
|
||||
[node name="Facade28" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(8768, 464)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_04")
|
||||
|
||||
[node name="Facade29" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(9079, 320)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_05")
|
||||
|
||||
[node name="Facade30" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(9390, 456)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_06")
|
||||
|
||||
[node name="Facade31" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(9701, 480)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_01")
|
||||
|
||||
[node name="Facade32" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(10060, 556)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_02")
|
||||
|
||||
[node name="Facade33" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(10371, 426)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_03")
|
||||
|
||||
[node name="Facade34" type="Sprite2D" parent="Facades"]
|
||||
position = Vector2(10682, 524)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("facade_04")
|
||||
|
||||
[node name="World" type="Node2D" parent="."]
|
||||
|
||||
[node name="Ground" type="StaticBody2D" parent="World"]
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Street01" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(740, 1095)
|
||||
shape = SubResource("Ground01")
|
||||
|
||||
[node name="Street02" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(2145, 1005)
|
||||
shape = SubResource("Ground02")
|
||||
|
||||
[node name="Street03" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(3480, 1140)
|
||||
shape = SubResource("Ground03")
|
||||
|
||||
[node name="Street04" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(4825, 1055)
|
||||
shape = SubResource("Ground04")
|
||||
|
||||
[node name="Street05" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(6150, 950)
|
||||
shape = SubResource("Ground05")
|
||||
|
||||
[node name="Street06" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(7440, 1125)
|
||||
shape = SubResource("Ground06")
|
||||
|
||||
[node name="Street07" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(8720, 1035)
|
||||
shape = SubResource("Ground07")
|
||||
|
||||
[node name="Street08" type="CollisionShape2D" parent="World/Ground"]
|
||||
position = Vector2(10180, 1095)
|
||||
shape = SubResource("Ground08")
|
||||
|
||||
[node name="Walkways" type="StaticBody2D" parent="World"]
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Walkway01" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(690, 720)
|
||||
shape = SubResource("Walkway01")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway02" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(950, 625)
|
||||
shape = SubResource("Walkway02")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway03" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(2135, 638)
|
||||
shape = SubResource("Walkway03")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway04" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(3180, 775)
|
||||
shape = SubResource("Walkway04")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway05" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(3405, 665)
|
||||
shape = SubResource("Walkway05")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway06" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(4720, 685)
|
||||
shape = SubResource("Walkway06")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway07" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(5780, 585)
|
||||
shape = SubResource("Walkway07")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway08" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(5995, 485)
|
||||
shape = SubResource("Walkway08")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway09" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(7360, 755)
|
||||
shape = SubResource("Walkway09")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway10" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(8705, 655)
|
||||
shape = SubResource("Walkway10")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Walkway11" type="CollisionShape2D" parent="World/Walkways"]
|
||||
position = Vector2(10035, 735)
|
||||
shape = SubResource("Walkway11")
|
||||
one_way_collision = true
|
||||
|
||||
[node name="Barriers" type="StaticBody2D" parent="World"]
|
||||
collision_layer = 1
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Left" type="CollisionShape2D" parent="World/Barriers"]
|
||||
position = Vector2(0, 690)
|
||||
shape = SubResource("BarrierShape")
|
||||
|
||||
[node name="Right" type="CollisionShape2D" parent="World/Barriers"]
|
||||
position = Vector2(11000, 690)
|
||||
shape = SubResource("BarrierShape")
|
||||
|
||||
[node name="StreetProps" type="Node2D" parent="."]
|
||||
z_index = 0
|
||||
|
||||
[node name="Lamp01" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(187, 493)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp02" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(1362, 493)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp03" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(2642, 403)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp04" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(4012, 538)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp05" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(5312, 453)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp06" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(6702, 348)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp07" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(7982, 523)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp08" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(9252, 433)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Lamp09" type="Sprite2D" parent="StreetProps"]
|
||||
position = Vector2(10722, 493)
|
||||
centered = false
|
||||
texture_filter = 1
|
||||
texture = ExtResource("art_streetlamp")
|
||||
modulate = Color(0.9, 0.86, 0.88, 1)
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("player")]
|
||||
position = Vector2(125, 795)
|
||||
show_debug_hitboxes = false
|
||||
special_radius = 290.0
|
||||
|
||||
|
||||
[node name="Enemies" type="Node2D" parent="."]
|
||||
|
||||
[node name="Enemy01" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(410, 811)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy02" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(915, 811)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy03" parent="Enemies" instance=ExtResource("enemy_rival_guitarist")]
|
||||
position = Vector2(970, 581)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy04" parent="Enemies" instance=ExtResource("enemy_feedback_tech")]
|
||||
position = Vector2(1770, 721)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy05" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(1880, 721)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy06" parent="Enemies" instance=ExtResource("enemy_backstage_guard")]
|
||||
position = Vector2(2260, 721)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy07" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(2450, 721)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy08" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(3030, 856)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy09" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(3170, 856)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy10" parent="Enemies" instance=ExtResource("enemy_rival_guitarist")]
|
||||
position = Vector2(3320, 856)
|
||||
show_debug_enemy_info = true
|
||||
guaranteed_drop = ExtResource("item_beer")
|
||||
|
||||
|
||||
[node name="Enemy11" parent="Enemies" instance=ExtResource("enemy_feedback_tech")]
|
||||
position = Vector2(3900, 856)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy12" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(4430, 771)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy13" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(4530, 771)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy14" parent="Enemies" instance=ExtResource("enemy_backstage_guard")]
|
||||
position = Vector2(5180, 771)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy15" parent="Enemies" instance=ExtResource("enemy_feedback_tech")]
|
||||
position = Vector2(5670, 666)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy16" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(5810, 666)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy17" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(5960, 666)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy18" parent="Enemies" instance=ExtResource("enemy_rival_guitarist")]
|
||||
position = Vector2(6500, 666)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy19" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(7010, 841)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy20" parent="Enemies" instance=ExtResource("enemy_feedback_tech")]
|
||||
position = Vector2(7150, 841)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy21" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(7320, 841)
|
||||
show_debug_enemy_info = true
|
||||
guaranteed_drop = ExtResource("item_pizza_post_bolo")
|
||||
|
||||
|
||||
[node name="Enemy22" parent="Enemies" instance=ExtResource("enemy_backstage_guard")]
|
||||
position = Vector2(7780, 841)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy23" parent="Enemies" instance=ExtResource("enemy_rival_guitarist")]
|
||||
position = Vector2(8380, 751)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy24" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(8510, 751)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy25" parent="Enemies" instance=ExtResource("enemy_feedback_tech")]
|
||||
position = Vector2(8950, 751)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy26" parent="Enemies" instance=ExtResource("enemy_roadie")]
|
||||
position = Vector2(9660, 811)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy27" parent="Enemies" instance=ExtResource("enemy_pogo_fan")]
|
||||
position = Vector2(9780, 811)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Enemy28" parent="Enemies" instance=ExtResource("enemy_rival_guitarist")]
|
||||
position = Vector2(9940, 811)
|
||||
show_debug_enemy_info = true
|
||||
guaranteed_drop = ExtResource("item_bocata_roadie")
|
||||
|
||||
|
||||
[node name="Enemy29" parent="Enemies" instance=ExtResource("enemy_backstage_guard")]
|
||||
position = Vector2(10420, 811)
|
||||
show_debug_enemy_info = true
|
||||
|
||||
|
||||
[node name="Items" type="Node2D" parent="."]
|
||||
|
||||
[node name="Pickup01" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(710, 670)
|
||||
pickup_data = ExtResource("item_beer")
|
||||
|
||||
|
||||
[node name="Pickup02" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(945, 575)
|
||||
pickup_data = ExtResource("item_pedal_distorsion")
|
||||
|
||||
|
||||
[node name="Pickup03" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(1550, 715)
|
||||
pickup_data = ExtResource("item_cinta_americana")
|
||||
|
||||
|
||||
[node name="Pickup04" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(2140, 588)
|
||||
pickup_data = ExtResource("item_casete_demo")
|
||||
|
||||
|
||||
[node name="Pickup05" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(3410, 615)
|
||||
pickup_data = ExtResource("item_muelles_stage")
|
||||
|
||||
|
||||
[node name="Pickup06" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(3840, 850)
|
||||
pickup_data = ExtResource("item_pizza_post_bolo")
|
||||
|
||||
|
||||
[node name="Pickup07" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(4700, 635)
|
||||
pickup_data = ExtResource("item_coffee")
|
||||
|
||||
|
||||
[node name="Pickup08" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(5760, 535)
|
||||
pickup_data = ExtResource("item_baqueta_sismica")
|
||||
|
||||
|
||||
[node name="Pickup09" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(5980, 435)
|
||||
pickup_data = ExtResource("item_amplificador_11")
|
||||
|
||||
|
||||
[node name="Pickup10" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(6920, 835)
|
||||
pickup_data = ExtResource("item_bocata_roadie")
|
||||
|
||||
|
||||
[node name="Pickup11" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(7380, 705)
|
||||
pickup_data = ExtResource("item_tapones_tecnico")
|
||||
|
||||
|
||||
[node name="Pickup12" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(8500, 745)
|
||||
pickup_data = ExtResource("item_tupper_bateria")
|
||||
|
||||
|
||||
[node name="Pickup13" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(8740, 605)
|
||||
pickup_data = ExtResource("item_botas_doble_bombo")
|
||||
|
||||
|
||||
[node name="Pickup14" parent="Items" instance=ExtResource("pickup")]
|
||||
position = Vector2(10030, 685)
|
||||
pickup_data = ExtResource("item_setlist_fin")
|
||||
|
||||
|
||||
[node name="FinishZone" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
position = Vector2(10850, 780)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="FinishZone"]
|
||||
shape = SubResource("FinishShape")
|
||||
|
||||
[node name="Sign01" type="Label" parent="."]
|
||||
offset_left = 300
|
||||
offset_top = 715
|
||||
offset_right = 560
|
||||
offset_bottom = 755
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.96, 0.80, 0.60, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.09, 0.1, 0.17, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "SALA RUIDO >>"
|
||||
|
||||
|
||||
[node name="Sign02" type="Label" parent="."]
|
||||
offset_left = 1610
|
||||
offset_top = 641
|
||||
offset_right = 1870
|
||||
offset_bottom = 681
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.96, 0.80, 0.60, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.09, 0.1, 0.17, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "SUBE AL BARRIO ALTO"
|
||||
|
||||
|
||||
[node name="Sign03" type="Label" parent="."]
|
||||
offset_left = 2890
|
||||
offset_top = 793
|
||||
offset_right = 3150
|
||||
offset_bottom = 833
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.96, 0.80, 0.60, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.09, 0.1, 0.17, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "BAJADA SIN FRENOS"
|
||||
|
||||
|
||||
[node name="Sign04" type="Label" parent="."]
|
||||
offset_left = 5420
|
||||
offset_top = 564
|
||||
offset_right = 5680
|
||||
offset_bottom = 604
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.96, 0.80, 0.60, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.09, 0.1, 0.17, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "ESCALERA A LOS TEJADOS"
|
||||
|
||||
|
||||
[node name="Sign05" type="Label" parent="."]
|
||||
offset_left = 6850
|
||||
offset_top = 745
|
||||
offset_right = 7110
|
||||
offset_bottom = 785
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.96, 0.80, 0.60, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.09, 0.1, 0.17, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "POGO MULTITUDINARIO"
|
||||
|
||||
|
||||
[node name="Sign06" type="Label" parent="."]
|
||||
offset_left = 10680
|
||||
offset_top = 659
|
||||
offset_right = 10940
|
||||
offset_bottom = 699
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 16
|
||||
theme_override_colors/font_color = Color(0.96, 0.80, 0.60, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.09, 0.1, 0.17, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "FIN DE LA GIRA!"
|
||||
|
||||
|
||||
[node name="LevelHUD" type="CanvasLayer" parent="."]
|
||||
layer = 87
|
||||
|
||||
[node name="Overlay" type="Control" parent="LevelHUD"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Status" type="Label" parent="LevelHUD/Overlay"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 1
|
||||
anchor_left = 1.0
|
||||
anchor_right = 1.0
|
||||
offset_left = -360.0
|
||||
offset_top = 16.0
|
||||
offset_right = -14.0
|
||||
offset_bottom = 70.0
|
||||
grow_horizontal = 0
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_font_sizes/font_size = 17
|
||||
theme_override_colors/font_color = Color(0.98, 0.87, 0.68, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.07, 0.06, 0.13, 1)
|
||||
theme_override_constants/shadow_offset_x = 2
|
||||
theme_override_constants/shadow_offset_y = 2
|
||||
text = "CALLE DEL FEEDBACK"
|
||||
horizontal_alignment = 2
|
||||
|
||||
[node name="FinishMessage" type="Label" parent="LevelHUD/Overlay"]
|
||||
layout_mode = 1
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.32
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.32
|
||||
offset_left = -330.0
|
||||
offset_top = -35.0
|
||||
offset_right = 330.0
|
||||
offset_bottom = 95.0
|
||||
theme_override_fonts/font = ExtResource("font")
|
||||
theme_override_colors/font_color = Color(1.0, 0.88, 0.48, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0.05, 0.05, 0.12, 1)
|
||||
theme_override_constants/shadow_offset_x = 3
|
||||
theme_override_constants/shadow_offset_y = 3
|
||||
theme_override_font_sizes/font_size = 32
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
visible = false
|
||||
|
||||
|
||||
[node name="MobileControls" parent="." instance=ExtResource("mobile")]
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/amplificador_11.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"amplificador_11"
|
||||
display_name = "Amplificador al 11"
|
||||
description = "El 10 era para cobardes."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.95294118, 0.49411765, 0.42745098, 1.0)
|
||||
effect_type = "special_charge"
|
||||
value = 100.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/baqueta_sismica.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"baqueta_sismica"
|
||||
display_name = "Baqueta Sismica"
|
||||
description = "Una prueba de sonido y desaparecio el suelo."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.91764706, 0.77254902, 0.54901961, 1.0)
|
||||
effect_type = "air_damage_boost"
|
||||
value = 0.5
|
||||
duration = 10.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/beer.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"beer"
|
||||
display_name = "Espuma del Pogo"
|
||||
description = "Espuma garantizada. El contenido, no tanto."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(1.00000000, 0.80392157, 0.35686275, 1.0)
|
||||
effect_type = "heal"
|
||||
value = 30.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/bocata_roadie.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"bocata_roadie"
|
||||
display_name = "Bocata del Roadie"
|
||||
description = "Lleva tres giras en la furgoneta."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.94117647, 0.68235294, 0.33333333, 1.0)
|
||||
effect_type = "heal"
|
||||
value = 20.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/botas_doble_bombo.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"botas_doble_bombo"
|
||||
display_name = "Botas del Doble Bombo"
|
||||
description = "El bateria marca el ritmo de la carrera."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.72549020, 0.60392157, 0.98039216, 1.0)
|
||||
effect_type = "speed_boost"
|
||||
value = 0.35
|
||||
duration = 8.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/casete_demo.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"casete_demo"
|
||||
display_name = "Casete de la Demo Perdida"
|
||||
description = "Grabado en un garaje. Se nota."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.92549020, 0.62352941, 0.80392157, 1.0)
|
||||
effect_type = "special_charge"
|
||||
value = 25.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/cinta_americana.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"cinta_americana"
|
||||
display_name = "Cinta Americana Infinita"
|
||||
description = "Arregla todo, menos la afinacion."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.63137255, 0.75686275, 0.80000000, 1.0)
|
||||
effect_type = "shield"
|
||||
value = 1.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/coffee.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"coffee"
|
||||
display_name = "Tostado del Averno"
|
||||
description = "240 BPM por las venas."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.60784314, 0.38431373, 0.26274510, 1.0)
|
||||
effect_type = "speed_boost"
|
||||
value = 0.25
|
||||
duration = 12.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/cuerda_titanio.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"cuerda_titanio"
|
||||
display_name = "Cuerda de Titanio"
|
||||
description = "No desafina. Tampoco perdona."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.89803922, 0.90196078, 0.98823529, 1.0)
|
||||
effect_type = "damage_boost"
|
||||
value = 0.2
|
||||
duration = 20.0
|
||||
@@ -0,0 +1,14 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/cinta_americana.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"lab_control"
|
||||
display_name = "Testigo del Laboratorio"
|
||||
description = "Un objeto de control para comprobar los pickups sin combatir."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.63137255, 0.75686275, 0.80000000, 1.0)
|
||||
effect_type = "shield"
|
||||
value = 1.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/lata_feedback.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"lata_feedback"
|
||||
display_name = "Lata de Feedback"
|
||||
description = "Hace mas ruido al abrirse que el guitarrista."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.96078431, 0.35686275, 0.47058824, 1.0)
|
||||
effect_type = "speed_boost"
|
||||
value = 0.15
|
||||
duration = 20.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/muelles_stage.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"muelles_stage"
|
||||
display_name = "Muelles del Stage Diving"
|
||||
description = "El aterrizaje no esta incluido."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.50980392, 0.84705882, 0.95294118, 1.0)
|
||||
effect_type = "jump_boost"
|
||||
value = 0.2
|
||||
duration = 12.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/pedal_distorsion.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"pedal_distorsion"
|
||||
display_name = "Pedal de Distorsion"
|
||||
description = "El tecnico de sonido ha dimitido."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.46274510, 0.74117647, 0.86274510, 1.0)
|
||||
effect_type = "damage_boost"
|
||||
value = 0.5
|
||||
duration = 7.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/pizza_post_bolo.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"pizza_post_bolo"
|
||||
display_name = "Pizza Post-Bolo"
|
||||
description = "La encontraron detras del amplificador."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.97647059, 0.62745098, 0.27843137, 1.0)
|
||||
effect_type = "heal"
|
||||
value = 45.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/pua_apocalipsis.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"pua_apocalipsis"
|
||||
display_name = "Pua del Apocalipsis"
|
||||
description = "Tres acordes. Cero supervivientes."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.86274510, 0.47058824, 0.97254902, 1.0)
|
||||
effect_type = "damage_boost"
|
||||
value = 0.3
|
||||
duration = 12.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/setlist_fin.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"setlist_fin"
|
||||
display_name = "Setlist del Fin del Mundo"
|
||||
description = "Si no queda escenario, el orden da igual."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.94509804, 0.90588235, 0.63921569, 1.0)
|
||||
effect_type = "special_charge"
|
||||
value = 50.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/tapones_tecnico.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"tapones_tecnico"
|
||||
display_name = "Tapones del Tecnico"
|
||||
description = "Por una vez, el tecnico tenia razon."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.76078431, 0.92156863, 0.49411765, 1.0)
|
||||
effect_type = "damage_reduction"
|
||||
value = 0.25
|
||||
duration = 12.0
|
||||
@@ -0,0 +1,15 @@
|
||||
[gd_resource type="Resource" script_class="PickupData" load_steps=3 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup_data.gd" id="1_data"]
|
||||
[ext_resource type="Texture2D" path="res://assets/pickups/tupper_bateria.svg" id="2_icon"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_data")
|
||||
id = &"tupper_bateria"
|
||||
display_name = "Tupper del Bateria"
|
||||
description = "Ni su madre recuerda que le puso."
|
||||
icon = ExtResource("2_icon")
|
||||
color = Color(0.51372549, 0.81568627, 0.77254902, 1.0)
|
||||
effect_type = "heal"
|
||||
value = 70.0
|
||||
duration = 0.0
|
||||
@@ -0,0 +1,63 @@
|
||||
extends Node
|
||||
class_name DropManager
|
||||
|
||||
const PICKUP_SCENE := preload("res://pickups/pickup.tscn")
|
||||
|
||||
|
||||
static func roll_drop(drop_table: PickupDropTable) -> Array[PickupData]:
|
||||
var result: Array[PickupData] = []
|
||||
if drop_table == null:
|
||||
return result
|
||||
|
||||
if randf() > drop_table.drop_chance:
|
||||
return result
|
||||
|
||||
var available: Array[PickupDrop] = drop_table.drops.duplicate()
|
||||
available = available.filter(func(d): return d.pickup != null)
|
||||
|
||||
var count := randi_range(drop_table.min_drops, drop_table.max_drops)
|
||||
if count < 0:
|
||||
count = 0
|
||||
if count > available.size():
|
||||
count = available.size()
|
||||
|
||||
for i in range(count):
|
||||
if available.is_empty():
|
||||
break
|
||||
var total_weight: float = 0.0
|
||||
for d in available:
|
||||
total_weight += max(d.weight, 0.0)
|
||||
if total_weight <= 0.0:
|
||||
break
|
||||
var r := randf() * total_weight
|
||||
var selected: PickupDrop = null
|
||||
for d in available:
|
||||
r -= max(d.weight, 0.0)
|
||||
if r <= 0.0:
|
||||
selected = d
|
||||
break
|
||||
if selected == null:
|
||||
selected = available.back()
|
||||
result.append(selected.pickup)
|
||||
available.erase(selected)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
static func spawn_drops(drops_data: Array[PickupData], parent: Node, position: Vector2) -> void:
|
||||
# Death can happen inside a physics collision callback. Adding a new Area2D
|
||||
# immediately at that point is unsafe: defer its entry into the scene tree.
|
||||
# Set its local position first so it never briefly enters at the origin.
|
||||
var local_position: Vector2 = position
|
||||
if parent is Node2D:
|
||||
local_position = (parent as Node2D).to_local(position)
|
||||
|
||||
for data in drops_data:
|
||||
if data == null:
|
||||
push_warning("A drop was requested without PickupData.")
|
||||
continue
|
||||
var pickup := PICKUP_SCENE.instantiate() as Pickup
|
||||
pickup.pickup_data = data
|
||||
pickup.collection_delay_seconds = Pickup.DROP_COLLECTION_DELAY_SECONDS
|
||||
pickup.position = local_position
|
||||
parent.call_deferred("add_child", pickup)
|
||||
@@ -0,0 +1,110 @@
|
||||
extends Area2D
|
||||
class_name Pickup
|
||||
|
||||
signal picked_up(pickup: Pickup, data: PickupData)
|
||||
|
||||
# Enemies leave their reward on screen briefly. A player who touches it during
|
||||
# that interval must still receive it, even if they keep running.
|
||||
const DROP_COLLECTION_DELAY_SECONDS: float = 0.75
|
||||
|
||||
@export var pickup_data: PickupData
|
||||
@export var collection_delay_seconds: float = 0.0
|
||||
@export var fall_speed: float = 150.0
|
||||
@export var bob_amplitude: float = 4.0
|
||||
@export var bob_speed: float = 3.0
|
||||
|
||||
var velocity: Vector2 = Vector2.ZERO
|
||||
var time: float = 0.0
|
||||
var start_y: float = 0.0
|
||||
var grounded: bool = false
|
||||
var _can_collect: bool = false
|
||||
var _pending_collector: Node2D # Player who crossed the pickup during its delay.
|
||||
|
||||
@onready var label: Label = $Label
|
||||
@onready var sprite: Sprite2D = $Sprite2D
|
||||
@onready var placeholder: ColorRect = $Sprite2D/ColorRect
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("pickup")
|
||||
body_entered.connect(_on_body_entered)
|
||||
|
||||
if pickup_data == null:
|
||||
push_error("Pickup without PickupData: %s" % get_path())
|
||||
label.text = "SIN DATOS"
|
||||
placeholder.color = Color.MAGENTA
|
||||
return
|
||||
|
||||
label.text = pickup_data.display_name
|
||||
sprite.texture = pickup_data.icon
|
||||
placeholder.visible = pickup_data.icon == null
|
||||
placeholder.color = pickup_data.color
|
||||
start_y = position.y
|
||||
|
||||
if collection_delay_seconds > 0.0:
|
||||
_enable_collection_after_delay()
|
||||
else:
|
||||
_can_collect = true
|
||||
|
||||
|
||||
func _enable_collection_after_delay() -> void:
|
||||
await get_tree().create_timer(collection_delay_seconds).timeout
|
||||
if not is_inside_tree():
|
||||
return
|
||||
_can_collect = true
|
||||
|
||||
# A body_entered signal received during the delay is not lost. Crossing a
|
||||
# spawning item counts as touching it, even if the player is now elsewhere.
|
||||
if is_instance_valid(_pending_collector):
|
||||
_on_body_entered(_pending_collector)
|
||||
_pending_collector = null
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
time += delta
|
||||
if not grounded:
|
||||
velocity.y += fall_speed * delta
|
||||
position += velocity * delta
|
||||
if is_on_floor():
|
||||
grounded = true
|
||||
velocity = Vector2.ZERO
|
||||
start_y = position.y
|
||||
else:
|
||||
position.y = start_y + sin(time * bob_speed) * bob_amplitude
|
||||
|
||||
# body_entered only fires at the start of a contact. Rechecking overlaps
|
||||
# also handles moving pickups and effects that were unusable on first touch
|
||||
# (e.g. a heal while HP was full, then the player takes damage).
|
||||
if pickup_data != null and not is_queued_for_deletion():
|
||||
for body in get_overlapping_bodies():
|
||||
_on_body_entered(body)
|
||||
if is_queued_for_deletion():
|
||||
break
|
||||
|
||||
|
||||
func is_on_floor() -> bool:
|
||||
var space = get_world_2d().direct_space_state
|
||||
var params = PhysicsRayQueryParameters2D.create(global_position, global_position + Vector2(0, 12))
|
||||
params.collision_mask = 1
|
||||
var result = space.intersect_ray(params)
|
||||
return result.size() > 0
|
||||
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
if pickup_data == null or is_queued_for_deletion():
|
||||
return
|
||||
if not body.is_in_group("player") or not body.has_method("collect_pickup"):
|
||||
return
|
||||
|
||||
if not _can_collect:
|
||||
_pending_collector = body
|
||||
return
|
||||
|
||||
if body.collect_pickup(pickup_data):
|
||||
picked_up.emit(self, pickup_data)
|
||||
queue_free()
|
||||
elif pickup_data.effect_type == "heal":
|
||||
# This is not a collision failure: the player already has full HP.
|
||||
label.text = "%s\n(HP LLENO)" % pickup_data.display_name
|
||||
elif pickup_data.effect_type == "special_charge":
|
||||
label.text = "%s\n(ESPECIAL LLENO)" % pickup_data.display_name
|
||||
@@ -0,0 +1,39 @@
|
||||
[gd_scene load_steps=4 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://pickups/pickup.gd" id="1_pickup"]
|
||||
[ext_resource type="FontFile" path="res://assets/fonts/PixelOperator8.ttf" id="2_font"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="PickupShape"]
|
||||
size = Vector2(28, 24)
|
||||
|
||||
[node name="Pickup" type="Area2D"]
|
||||
z_index = 2
|
||||
collision_layer = 0
|
||||
collision_mask = 2
|
||||
monitoring = true
|
||||
script = ExtResource("1_pickup")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
modulate = Color(1, 1, 1, 1)
|
||||
scale = Vector2(0.5, 0.5)
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="Sprite2D"]
|
||||
offset_left = -16.0
|
||||
offset_top = -16.0
|
||||
offset_right = 16.0
|
||||
offset_bottom = 16.0
|
||||
color = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("PickupShape")
|
||||
|
||||
[node name="Label" type="Label" parent="."]
|
||||
offset_left = -32.0
|
||||
offset_top = -28.0
|
||||
offset_right = 32.0
|
||||
offset_bottom = -12.0
|
||||
theme_override_fonts/font = ExtResource("2_font")
|
||||
theme_override_font_sizes/font_size = 8
|
||||
text = "Item"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Resource
|
||||
class_name PickupData
|
||||
|
||||
@export_category("Identity")
|
||||
@export var id: StringName = &"pickup"
|
||||
@export var display_name: String = "Item"
|
||||
@export_multiline var description: String = ""
|
||||
|
||||
@export_category("Visuals")
|
||||
@export var icon: Texture2D
|
||||
@export var color: Color = Color(1.0, 0.7, 0.2)
|
||||
|
||||
@export_category("Effect")
|
||||
## heal and special_charge are instant; shield absorbs one hit; others expire.
|
||||
## value is an absolute amount for heal/charge, a fractional bonus for timed buffs.
|
||||
@export_enum("heal", "speed_boost", "damage_boost", "special_charge", "shield", "damage_reduction", "jump_boost", "air_damage_boost") var effect_type: String = "heal"
|
||||
@export var value: float = 0.0
|
||||
@export var duration: float = 0.0
|
||||
@@ -0,0 +1,5 @@
|
||||
extends Resource
|
||||
class_name PickupDrop
|
||||
|
||||
@export var pickup: PickupData
|
||||
@export_range(0.0, 100.0, 0.1) var weight: float = 1.0
|
||||
@@ -0,0 +1,7 @@
|
||||
extends Resource
|
||||
class_name PickupDropTable
|
||||
|
||||
@export var drops: Array[PickupDrop] = []
|
||||
@export_range(0.0, 1.0) var drop_chance: float = 0.5
|
||||
@export_range(0, 10, 1) var min_drops: int = 1
|
||||
@export_range(0, 10, 1) var max_drops: int = 1
|
||||
@@ -6,5 +6,5 @@ extends Camera2D
|
||||
func _ready() -> void:
|
||||
limit_left = 0
|
||||
limit_top = 0
|
||||
limit_right = 3000
|
||||
limit_bottom = 2000
|
||||
limit_right = 4000
|
||||
limit_bottom = 2500
|
||||
@@ -20,5 +20,5 @@ class_name CharacterData
|
||||
@export_range(1, 100, 1) var max_health: int = 5
|
||||
@export var move_speed: float = 400.0
|
||||
@export var jump_velocity: float = -600.0
|
||||
@export_range(0, 100, 1) var basic_attack_damage: int = 1
|
||||
@export_range(0, 100, 1) var air_attack_damage: int = 3
|
||||
@export_range(0, 100, 1) var basic_attack_damage: int = 5
|
||||
@export_range(0, 100, 1) var air_attack_damage: int = 10
|
||||
@@ -8,8 +8,8 @@ script = ExtResource("1_data")
|
||||
id = &"bassist"
|
||||
display_name = "Bassist"
|
||||
sprite_frames = ExtResource("2_frames")
|
||||
max_health = 5
|
||||
move_speed = 400.0
|
||||
max_health = 50
|
||||
move_speed = 390.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -8,8 +8,8 @@ script = ExtResource("1_data")
|
||||
id = &"drummer"
|
||||
display_name = "Drummer"
|
||||
sprite_frames = ExtResource("2_frames")
|
||||
max_health = 5
|
||||
move_speed = 400.0
|
||||
max_health = 50
|
||||
move_speed = 390.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -8,8 +8,8 @@ script = ExtResource("1_data")
|
||||
id = &"guitarist"
|
||||
display_name = "Guitarist"
|
||||
sprite_frames = ExtResource("2_frames")
|
||||
max_health = 5
|
||||
move_speed = 400.0
|
||||
max_health = 50
|
||||
move_speed = 390.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_resource type="SpriteFrames" load_steps=36 format=3]
|
||||
[gd_resource type="SpriteFrames" format=3 uid="uid://s2xmt6mpri5c"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cjxrw1p7eh82i" path="res://assets/characters/ankarde/Diego-idle-trimmed.png" id="1_idle"]
|
||||
[ext_resource type="Texture2D" uid="uid://dg1x17ci14p4f" path="res://assets/characters/ankarde/Diego-walk-trimmed.png" id="2_walk"]
|
||||
|
||||
@@ -8,8 +8,8 @@ script = ExtResource("1_data")
|
||||
id = &"singer"
|
||||
display_name = "Singer"
|
||||
sprite_frames = ExtResource("2_frames")
|
||||
max_health = 5
|
||||
move_speed = 400.0
|
||||
max_health = 50
|
||||
move_speed = 390.0
|
||||
jump_velocity = -600.0
|
||||
basic_attack_damage = 1
|
||||
air_attack_damage = 3
|
||||
basic_attack_damage = 5
|
||||
air_attack_damage = 10
|
||||
@@ -3,6 +3,10 @@ extends CharacterBody2D
|
||||
|
||||
signal health_changed(current_health: int, max_health: int)
|
||||
signal died
|
||||
signal special_charge_changed(current_charge: int, max_charge: int)
|
||||
## Emitted only after an object successfully applies its effect.
|
||||
## The test level uses this signal to count items actually collected.
|
||||
signal pickup_collected(data: PickupData)
|
||||
|
||||
|
||||
# Collision layers used by this first playable slice.
|
||||
@@ -33,19 +37,19 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
@export_category("Movement")
|
||||
|
||||
## Reaches full running speed quickly, but not instantly.
|
||||
@export var ground_acceleration: float = 3600.0
|
||||
@export var ground_acceleration: float = 4000.0
|
||||
|
||||
## Used when there is no horizontal input. Slightly stronger than acceleration
|
||||
## so releasing the controls feels precise instead of slippery.
|
||||
@export var ground_friction: float = 4800.0
|
||||
@export var ground_friction: float = 5000.0
|
||||
|
||||
## Braking used only when the player asks for the opposite direction. The
|
||||
## character loses the old momentum first and then accelerates the other way,
|
||||
## producing a small but readable turn delay.
|
||||
@export var turn_braking: float = 5600.0
|
||||
## producing a small but turning is snappy enough.
|
||||
@export var turn_braking: float = 5800.0
|
||||
|
||||
## Air control stays responsive but weaker than movement on the floor.
|
||||
@export var air_acceleration: float = 1800.0
|
||||
@export var air_acceleration: float = 2000.0
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -55,17 +59,29 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
@export_category("Jump")
|
||||
|
||||
## Allows a jump a few milliseconds after walking off a ledge.
|
||||
@export var coyote_time: float = 0.12
|
||||
@export var coyote_time: float = 0.17
|
||||
|
||||
## Remembers an early jump press just before landing.
|
||||
@export var jump_buffer_time: float = 0.12
|
||||
@export var jump_buffer_time: float = 0.17
|
||||
|
||||
## Releasing jump while rising cuts the jump short.
|
||||
@export_range(0.1, 1.0) var jump_cut_multiplier: float = 0.45
|
||||
@export_range(0.1, 1.0) var jump_cut_multiplier: float = 0.43
|
||||
|
||||
@export var gravity_multiplier: float = 1.0
|
||||
@export var fall_gravity_multiplier: float = 1.7
|
||||
@export var max_fall_speed: float = 1200.0
|
||||
@export var fall_gravity_multiplier: float = 1.6
|
||||
@export var max_fall_speed: float = 1400.0
|
||||
|
||||
|
||||
@export_category("Double Jump")
|
||||
|
||||
## Enables a second jump while in the air.
|
||||
@export var enable_double_jump: bool = true
|
||||
|
||||
## Maximum number of jumps allowed (1 = only ground/coyote, 2 = double jump).
|
||||
@export_range(1, 2, 1) var max_jumps: int = 2
|
||||
|
||||
## Height multiplier applied to the second jump relative to the character's jump force.
|
||||
@export_range(0.5, 0.95, 0.01) var double_jump_multiplier: float = 0.8
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -78,7 +94,7 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
@export var invulnerability_duration: float = 0.65
|
||||
|
||||
## Horizontal and vertical impulse applied when the player is hit.
|
||||
@export var damage_knockback: Vector2 = Vector2(300.0, 260.0)
|
||||
@export var damage_knockback: Vector2 = Vector2(310.0, 270.0)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -89,8 +105,8 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
|
||||
@export var punch_duration: float = 0.13
|
||||
@export var punch_cooldown: float = 0.28
|
||||
@export var punch_hitbox_size: Vector2 = Vector2(55.0, 38.0)
|
||||
@export var punch_offset: Vector2 = Vector2(48.0, 0.0)
|
||||
@export var punch_hitbox_size: Vector2 = Vector2(34.0, 24.0)
|
||||
@export var punch_offset: Vector2 = Vector2(30.0, 0.0)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -108,8 +124,37 @@ const ENEMY_HURTBOX_MASK: int = 1 << 4
|
||||
## Small amount of steering kept during the fall.
|
||||
@export_range(0.0, 1.0) var ground_pound_horizontal_control: float = 0.25
|
||||
|
||||
@export var ground_pound_radius: float = 85.0
|
||||
@export var ground_pound_offset: Vector2 = Vector2(0.0, 28.0)
|
||||
@export var ground_pound_radius: float = 54.0
|
||||
@export var ground_pound_offset: Vector2 = Vector2(0.0, 18.0)
|
||||
|
||||
## From 7 damage on a small jump to 12 on a high one; always stronger
|
||||
## than a standard 5-point punch, even without any pickup.
|
||||
@export var ground_pound_damage_per_pixel: float = 0.065
|
||||
@export_range(1, 100, 1) var ground_pound_min_damage: int = 7
|
||||
@export_range(1, 100, 1) var ground_pound_max_damage: int = 12
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# SPECIAL ATTACK
|
||||
# ============================================================================
|
||||
|
||||
@export_category("Special Attack")
|
||||
|
||||
## Maximum charge of the special meter (0-100).
|
||||
@export_range(0, 100, 1) var special_max_charge: int = 100
|
||||
|
||||
## Charge gained when an enemy dies.
|
||||
@export_range(0, 100, 1) var special_charge_per_kill: int = 25
|
||||
|
||||
## Minimum charge required to use special attack.
|
||||
@export_range(0, 100, 1) var special_min_use_charge: int = 25
|
||||
|
||||
## Maximum damage dealt by the special (at full charge, closest to player).
|
||||
@export_range(0, 100, 1) var special_max_damage: int = 30
|
||||
|
||||
## Optional hard cutoff for the special. Very large = previous full-screen behaviour.
|
||||
## The Level 01 test sets a smaller radius to keep encounters independent.
|
||||
@export var special_radius: float = 100000.0
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -156,10 +201,35 @@ var ground_pound_active: bool = false
|
||||
var ground_pound_debug_timer: float = 0.0
|
||||
var is_dead: bool = false
|
||||
|
||||
var jumps_remaining: int = 2
|
||||
|
||||
var _speed_boost_timer: float = 0.0
|
||||
var _speed_boost_multiplier: float = 0.0
|
||||
# Only runtime state changes: CharacterData remains immutable during pickups.
|
||||
var _damage_boost_timer: float = 0.0
|
||||
var _damage_boost_multiplier: float = 0.0
|
||||
var _air_damage_boost_timer: float = 0.0
|
||||
var _air_damage_boost_multiplier: float = 0.0
|
||||
var _damage_reduction_timer: float = 0.0
|
||||
var _damage_reduction_fraction: float = 0.0
|
||||
var _jump_boost_timer: float = 0.0
|
||||
var _jump_boost_multiplier: float = 0.0
|
||||
var _shield_hits: int = 0
|
||||
|
||||
var _floating_texts: Array = []
|
||||
|
||||
# Tracks the highest point reached since leaving the ground, used to scale
|
||||
# ground pound damage by jump height instead of fall distance.
|
||||
var _jump_height_tracking: bool = false
|
||||
var _jump_start_position: Vector2
|
||||
var _jump_peak_height: float = 0.0
|
||||
|
||||
## Prevents one target from receiving damage every physics frame during the
|
||||
## same punch. A new punch starts with an empty set again.
|
||||
var punch_hit_targets: Dictionary = {}
|
||||
|
||||
var special_charge: int = 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
if character_data == null:
|
||||
@@ -170,10 +240,16 @@ func _ready() -> void:
|
||||
if character_data.sprite_frames != null:
|
||||
animated_sprite.sprite_frames = character_data.sprite_frames
|
||||
|
||||
jumps_remaining = max_jumps
|
||||
|
||||
_setup_attack_hitboxes()
|
||||
_update_facing()
|
||||
_update_animation()
|
||||
health_changed.emit(current_health, character_data.max_health)
|
||||
special_charge_changed.emit(special_charge, special_max_charge)
|
||||
# Conecta a los enemigos que ya estén en el árbol. Si se añaden más tarde,
|
||||
# se conectarán cuando mueran mediante el grupo "enemy".
|
||||
_connect_to_enemies()
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
@@ -189,12 +265,27 @@ func _physics_process(delta: float) -> void:
|
||||
_apply_gravity(delta)
|
||||
_handle_horizontal_movement(delta)
|
||||
_update_punch_damage()
|
||||
_update_floating_texts(delta)
|
||||
|
||||
move_and_slide()
|
||||
|
||||
# Track the highest point reached since leaving the ground, so ground pound
|
||||
# damage is based on jump height rather than the current fall distance.
|
||||
if not is_on_floor():
|
||||
if not _jump_height_tracking:
|
||||
_jump_height_tracking = true
|
||||
_jump_start_position = global_position
|
||||
_jump_peak_height = global_position.y
|
||||
else:
|
||||
_jump_peak_height = min(_jump_peak_height, global_position.y)
|
||||
elif _jump_height_tracking:
|
||||
_jump_height_tracking = false
|
||||
|
||||
# Landing is only reliable after move_and_slide() has resolved collisions.
|
||||
if ground_pound_active and not was_on_floor and is_on_floor():
|
||||
_ground_pound_impact()
|
||||
if not was_on_floor and is_on_floor():
|
||||
jumps_remaining = max_jumps
|
||||
if ground_pound_active:
|
||||
_ground_pound_impact()
|
||||
|
||||
_update_animation()
|
||||
queue_redraw()
|
||||
@@ -211,7 +302,7 @@ func _handle_horizontal_movement(delta: float) -> void:
|
||||
facing_direction = signf(direction)
|
||||
_update_facing()
|
||||
|
||||
var target_speed: float = direction * character_data.move_speed
|
||||
var target_speed: float = direction * get_move_speed()
|
||||
|
||||
if ground_pound_active:
|
||||
target_speed *= ground_pound_horizontal_control
|
||||
@@ -240,6 +331,15 @@ func _handle_horizontal_movement(delta: float) -> void:
|
||||
velocity.x = move_toward(velocity.x, target_speed, air_acceleration * delta)
|
||||
|
||||
|
||||
## Horizontal running speed with active pickups applied. Keeping the HUD and
|
||||
## movement on the same calculation avoids showing a bonus that isn't used.
|
||||
func get_move_speed() -> float:
|
||||
if character_data == null:
|
||||
return 0.0
|
||||
var bonus: float = _speed_boost_multiplier if _speed_boost_timer > 0.0 else 0.0
|
||||
return character_data.move_speed * (1.0 + bonus)
|
||||
|
||||
|
||||
func _update_facing() -> void:
|
||||
animated_sprite.flip_h = facing_direction < 0.0
|
||||
|
||||
@@ -274,6 +374,7 @@ func _apply_gravity(delta: float) -> void:
|
||||
func _update_jump_windows(delta: float) -> void:
|
||||
if is_on_floor():
|
||||
coyote_timer = coyote_time
|
||||
jumps_remaining = max_jumps
|
||||
else:
|
||||
coyote_timer = max(coyote_timer - delta, 0.0)
|
||||
|
||||
@@ -286,12 +387,17 @@ func _update_jump_windows(delta: float) -> void:
|
||||
func _handle_jump() -> void:
|
||||
if (
|
||||
jump_buffer_timer > 0.0
|
||||
and coyote_timer > 0.0
|
||||
and not ground_pound_active
|
||||
):
|
||||
velocity.y = character_data.jump_velocity
|
||||
jump_buffer_timer = 0.0
|
||||
coyote_timer = 0.0
|
||||
if is_on_floor() or coyote_timer > 0.0:
|
||||
velocity.y = character_data.jump_velocity * (1.0 + _jump_boost_multiplier)
|
||||
jump_buffer_timer = 0.0
|
||||
coyote_timer = 0.0
|
||||
jumps_remaining = max(0, max_jumps - 1)
|
||||
elif enable_double_jump and jumps_remaining > 0:
|
||||
velocity.y = character_data.jump_velocity * (1.0 + _jump_boost_multiplier) * double_jump_multiplier
|
||||
jump_buffer_timer = 0.0
|
||||
jumps_remaining -= 1
|
||||
|
||||
if Input.is_action_just_released("jump") and velocity.y < 0.0:
|
||||
velocity.y *= jump_cut_multiplier
|
||||
@@ -302,16 +408,20 @@ func _handle_jump() -> void:
|
||||
# ============================================================================
|
||||
|
||||
func _handle_attack_input() -> void:
|
||||
if not Input.is_action_just_pressed("attack"):
|
||||
return
|
||||
|
||||
if attack_cooldown_timer > 0.0:
|
||||
return
|
||||
|
||||
if is_on_floor():
|
||||
if Input.is_action_just_pressed("attack"):
|
||||
_start_punch()
|
||||
else:
|
||||
_start_ground_pound()
|
||||
return
|
||||
|
||||
if Input.is_action_just_pressed("ground_pound"):
|
||||
# The ground pound is an air attack: it only triggers while jumping or
|
||||
# falling, so it never replaces a grounded punch.
|
||||
if not is_on_floor():
|
||||
_start_ground_pound()
|
||||
return
|
||||
|
||||
if Input.is_action_just_pressed("special_attack"):
|
||||
_start_special_attack()
|
||||
return
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -329,7 +439,7 @@ func _update_punch_damage() -> void:
|
||||
return
|
||||
|
||||
for area in punch_hitbox.get_overlapping_areas():
|
||||
_damage_target(area, character_data.basic_attack_damage, punch_hit_targets)
|
||||
_damage_target(area, roundi(character_data.basic_attack_damage * (1.0 + _damage_boost_multiplier)), punch_hit_targets)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -352,10 +462,177 @@ func _ground_pound_impact() -> void:
|
||||
ground_pound_active = false
|
||||
ground_pound_debug_timer = debug_impact_duration
|
||||
|
||||
# Damage scales with jump height: how high the player rose from the takeoff
|
||||
# point, clamped between the min and max damage.
|
||||
var height_reached: float = _jump_start_position.y - _jump_peak_height
|
||||
if height_reached < 0.0:
|
||||
height_reached = 0.0
|
||||
|
||||
var damage: int = clamp(
|
||||
int(height_reached * ground_pound_damage_per_pixel),
|
||||
ground_pound_min_damage,
|
||||
ground_pound_max_damage
|
||||
)
|
||||
|
||||
var hit_targets: Dictionary = {}
|
||||
|
||||
# The final damage is capped too: active buffs make the 12-point ceiling
|
||||
# easier to reach, rather than turning an alpha attack into a one-shot.
|
||||
var final_damage: int = mini(
|
||||
roundi(damage * (1.0 + _damage_boost_multiplier + _air_damage_boost_multiplier)),
|
||||
ground_pound_max_damage
|
||||
)
|
||||
for area in ground_pound_hitbox.get_overlapping_areas():
|
||||
_damage_target(area, character_data.air_attack_damage, hit_targets)
|
||||
_damage_target(area, final_damage, hit_targets)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# SPECIAL ATTACK
|
||||
# ============================================================================
|
||||
|
||||
func _start_special_attack() -> void:
|
||||
if is_dead:
|
||||
return
|
||||
|
||||
if special_charge < special_min_use_charge:
|
||||
return
|
||||
|
||||
var charge_used: int = special_charge
|
||||
# Consume all current charge
|
||||
special_charge = 0
|
||||
special_charge_changed.emit(special_charge, special_max_charge)
|
||||
|
||||
_apply_special_attack(charge_used)
|
||||
|
||||
|
||||
func _apply_special_attack(charge_used: int = special_max_charge) -> void:
|
||||
var charge_ratio: float = clamp(float(charge_used) / float(special_max_charge), 0.0, 1.0)
|
||||
|
||||
var hit_targets: Dictionary = {}
|
||||
|
||||
# Get viewport size to scale falloff across the whole screen
|
||||
var viewport: Viewport = get_viewport()
|
||||
var viewport_rect: Rect2 = viewport.get_visible_rect()
|
||||
var max_distance: float = max(viewport_rect.size.x, viewport_rect.size.y) * 0.8
|
||||
if max_distance < 1.0:
|
||||
max_distance = special_radius
|
||||
|
||||
for enemy in get_tree().get_nodes_in_group("enemy"):
|
||||
if not is_instance_valid(enemy):
|
||||
continue
|
||||
|
||||
if not enemy.has_method("take_damage"):
|
||||
continue
|
||||
|
||||
var distance: float = global_position.distance_to(enemy.global_position)
|
||||
if special_radius > 0.0 and distance > special_radius:
|
||||
continue
|
||||
# Damage falls off with distance: maximum at the player, lower farther away
|
||||
# affects the whole screen (no hard circle cutoff)
|
||||
var distance_factor: float = 1.0 - clamp(distance / max_distance, 0.0, 1.0)
|
||||
# Ensure it still affects even if very far, just minimal
|
||||
if distance_factor < 0.1:
|
||||
distance_factor = 0.1
|
||||
|
||||
var damage: int = int(special_max_damage * charge_ratio * distance_factor)
|
||||
if damage < 1:
|
||||
damage = 1
|
||||
|
||||
var enemy_id: int = enemy.get_instance_id()
|
||||
if hit_targets.has(enemy_id):
|
||||
continue
|
||||
|
||||
hit_targets[enemy_id] = true
|
||||
enemy.take_damage(damage, global_position)
|
||||
|
||||
|
||||
func collect_pickup(data: PickupData) -> bool:
|
||||
if is_dead or data == null or character_data == null:
|
||||
return false
|
||||
|
||||
match data.effect_type:
|
||||
"heal":
|
||||
var heal_amount: int = mini(int(data.value), character_data.max_health - current_health)
|
||||
if heal_amount <= 0:
|
||||
return false
|
||||
current_health += heal_amount
|
||||
health_changed.emit(current_health, character_data.max_health)
|
||||
_spawn_floating_text("+" + str(heal_amount), Color(0.2, 1.0, 0.3))
|
||||
"speed_boost":
|
||||
if data.value <= 0.0 or data.duration <= 0.0:
|
||||
return false
|
||||
_speed_boost_multiplier = max(_speed_boost_multiplier, data.value) if _speed_boost_timer > 0.0 else data.value
|
||||
_speed_boost_timer = data.duration
|
||||
_spawn_floating_text("SPEED UP", Color(1.0, 0.8, 0.2))
|
||||
"damage_boost", "air_damage_boost", "damage_reduction", "jump_boost":
|
||||
if data.value <= 0.0 or data.duration <= 0.0:
|
||||
return false
|
||||
# Repeated pickup refreshes time and keeps the strongest bonus.
|
||||
match data.effect_type:
|
||||
"damage_boost":
|
||||
_damage_boost_multiplier = max(_damage_boost_multiplier, data.value) if _damage_boost_timer > 0.0 else data.value
|
||||
_damage_boost_timer = data.duration
|
||||
"air_damage_boost":
|
||||
_air_damage_boost_multiplier = max(_air_damage_boost_multiplier, data.value) if _air_damage_boost_timer > 0.0 else data.value
|
||||
_air_damage_boost_timer = data.duration
|
||||
"damage_reduction":
|
||||
_damage_reduction_fraction = max(_damage_reduction_fraction, data.value) if _damage_reduction_timer > 0.0 else data.value
|
||||
_damage_reduction_timer = data.duration
|
||||
"jump_boost":
|
||||
_jump_boost_multiplier = max(_jump_boost_multiplier, data.value) if _jump_boost_timer > 0.0 else data.value
|
||||
_jump_boost_timer = data.duration
|
||||
_spawn_floating_text(data.display_name, data.color)
|
||||
"special_charge":
|
||||
var new_charge: int = mini(special_max_charge, special_charge + int(data.value))
|
||||
if new_charge <= special_charge:
|
||||
return false
|
||||
special_charge = new_charge
|
||||
special_charge_changed.emit(special_charge, special_max_charge)
|
||||
_spawn_floating_text("SPECIAL +" + str(int(data.value)), data.color)
|
||||
"shield":
|
||||
if data.value <= 0.0:
|
||||
return false
|
||||
_shield_hits = maxi(_shield_hits, int(data.value))
|
||||
_spawn_floating_text("SHIELD", data.color)
|
||||
_:
|
||||
push_warning("Unknown pickup effect: %s" % data.effect_type)
|
||||
return false
|
||||
pickup_collected.emit(data)
|
||||
return true
|
||||
|
||||
|
||||
func _spawn_floating_text(text: String, color: Color) -> void:
|
||||
var entry := {
|
||||
"text": text,
|
||||
"timer": 1.2,
|
||||
"pos": Vector2(-12, -60),
|
||||
"color": color,
|
||||
"velocity": Vector2(0, -25)
|
||||
}
|
||||
_floating_texts.append(entry)
|
||||
|
||||
|
||||
func _update_floating_texts(delta: float) -> void:
|
||||
for entry in _floating_texts:
|
||||
entry.pos += entry.velocity * delta
|
||||
entry.timer -= delta
|
||||
_floating_texts = _floating_texts.filter(func(e): return e.timer > 0.0)
|
||||
|
||||
|
||||
func _connect_to_enemies() -> void:
|
||||
for enemy in get_tree().get_nodes_in_group("enemy"):
|
||||
if is_instance_valid(enemy) and enemy.has_signal(&"died"):
|
||||
# The group yields Node references, not a statically typed Walker.
|
||||
# Node.connect also works with any future enemy exposing this signal.
|
||||
enemy.connect(&"died", _on_enemy_died.bind(enemy))
|
||||
|
||||
|
||||
func _on_enemy_died(enemy: Node) -> void:
|
||||
if is_dead:
|
||||
return
|
||||
|
||||
special_charge = min(special_charge + special_charge_per_kill, special_max_charge)
|
||||
special_charge_changed.emit(special_charge, special_max_charge)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
@@ -385,6 +662,15 @@ func take_damage(amount: int, source_position: Vector2) -> void:
|
||||
if amount <= 0 or is_dead or invulnerability_timer > 0.0:
|
||||
return
|
||||
|
||||
if _shield_hits > 0:
|
||||
_shield_hits -= 1
|
||||
invulnerability_timer = invulnerability_duration
|
||||
_spawn_floating_text("BLOCK!", Color(0.7, 0.9, 1.0))
|
||||
return
|
||||
|
||||
# At least one point of damage passes through an active reduction.
|
||||
if _damage_reduction_timer > 0.0:
|
||||
amount = maxi(1, roundi(amount * (1.0 - clampf(_damage_reduction_fraction, 0.0, 0.95))))
|
||||
current_health = max(current_health - amount, 0)
|
||||
invulnerability_timer = invulnerability_duration
|
||||
|
||||
@@ -425,6 +711,23 @@ func _update_timers(delta: float) -> void:
|
||||
attack_cooldown_timer = max(attack_cooldown_timer - delta, 0.0)
|
||||
ground_pound_debug_timer = max(ground_pound_debug_timer - delta, 0.0)
|
||||
invulnerability_timer = max(invulnerability_timer - delta, 0.0)
|
||||
if _speed_boost_timer > 0.0:
|
||||
_speed_boost_timer = max(_speed_boost_timer - delta, 0.0)
|
||||
else:
|
||||
_speed_boost_multiplier = 0.0
|
||||
# Each effect expires independently; no mutation of the character resource.
|
||||
_damage_boost_timer = maxf(0.0, _damage_boost_timer - delta)
|
||||
_air_damage_boost_timer = maxf(0.0, _air_damage_boost_timer - delta)
|
||||
_damage_reduction_timer = maxf(0.0, _damage_reduction_timer - delta)
|
||||
_jump_boost_timer = maxf(0.0, _jump_boost_timer - delta)
|
||||
if _damage_boost_timer == 0.0:
|
||||
_damage_boost_multiplier = 0.0
|
||||
if _air_damage_boost_timer == 0.0:
|
||||
_air_damage_boost_multiplier = 0.0
|
||||
if _damage_reduction_timer == 0.0:
|
||||
_damage_reduction_fraction = 0.0
|
||||
if _jump_boost_timer == 0.0:
|
||||
_jump_boost_multiplier = 0.0
|
||||
|
||||
|
||||
func _update_animation() -> void:
|
||||
@@ -485,12 +788,12 @@ func _draw() -> void:
|
||||
# Ground pound: show the real damage radius throughout the fall, then make
|
||||
# it stronger for a few frames at the exact impact moment.
|
||||
if ground_pound_active or ground_pound_debug_timer > 0.0:
|
||||
var fill_alpha: float = 0.14 if ground_pound_active else 0.28
|
||||
var outline_alpha: float = 0.60 if ground_pound_active else 0.95
|
||||
var pound_fill_alpha: float = 0.14 if ground_pound_active else 0.28
|
||||
var pound_outline_alpha: float = 0.60 if ground_pound_active else 0.95
|
||||
draw_circle(
|
||||
ground_pound_hitbox.position,
|
||||
ground_pound_radius,
|
||||
Color(1.0, 0.18, 0.05, fill_alpha)
|
||||
Color(1.0, 0.18, 0.05, pound_fill_alpha)
|
||||
)
|
||||
draw_arc(
|
||||
ground_pound_hitbox.position,
|
||||
@@ -498,10 +801,41 @@ func _draw() -> void:
|
||||
0.0,
|
||||
TAU,
|
||||
48,
|
||||
Color(1.0, 0.18, 0.05, outline_alpha),
|
||||
Color(1.0, 0.18, 0.05, pound_outline_alpha),
|
||||
2.0
|
||||
)
|
||||
|
||||
# Special: show full-screen effect indication. Brighter when fully charged.
|
||||
var fill_alpha: float = 0.05
|
||||
var outline_alpha: float = 0.25
|
||||
if special_charge >= special_min_use_charge:
|
||||
fill_alpha = 0.12
|
||||
outline_alpha = 0.6
|
||||
var viewport_rect: Rect2 = get_viewport().get_visible_rect()
|
||||
var camera: Camera2D = get_viewport().get_camera_2d()
|
||||
var screen_pos: Vector2 = Vector2.ZERO
|
||||
if camera != null:
|
||||
screen_pos = to_local(camera.get_screen_center_position())
|
||||
draw_rect(
|
||||
Rect2(screen_pos - viewport_rect.size * 0.5, viewport_rect.size),
|
||||
Color(1.0, 0.6, 0.05, fill_alpha),
|
||||
true
|
||||
)
|
||||
draw_rect(
|
||||
Rect2(screen_pos - viewport_rect.size * 0.5, viewport_rect.size),
|
||||
Color(1.0, 0.6, 0.05, outline_alpha),
|
||||
false,
|
||||
2.0
|
||||
)
|
||||
|
||||
var font: Font = ThemeDB.get_default_theme().get_font("font", "Label")
|
||||
if font != null:
|
||||
for entry in _floating_texts:
|
||||
var alpha: float = clamp(entry.timer / 1.2, 0.0, 1.0)
|
||||
var col = entry.color
|
||||
col.a = alpha
|
||||
draw_string(font, entry.pos, entry.text, 0, -1, 14, col)
|
||||
|
||||
|
||||
func _draw_rectangle_collision(
|
||||
collision: CollisionShape2D,
|
||||
|
||||
@@ -1,61 +1,57 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://nwbjxttgghpq"]
|
||||
[gd_scene format=3 uid="uid://nwbjxttgghpq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dccfebno1gvh7" path="res://player/player.gd" id="1_player"]
|
||||
[ext_resource type="SpriteFrames" path="res://player/characters/shared/prototype_sprite_frames.tres" id="2_frames"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://s2xmt6mpri5c" path="res://player/characters/shared/prototype_sprite_frames.tres" id="2_frames"]
|
||||
[ext_resource type="Script" uid="uid://kg3i7b0dj2p8" path="res://player/camera_2d.gd" id="3_camera"]
|
||||
[ext_resource type="Resource" path="res://player/characters/singer.tres" id="4_character"]
|
||||
[ext_resource type="PackedScene" path="res://ui/hud/player_health_hud.tscn" id="5_health_hud"]
|
||||
[ext_resource type="PackedScene" path="res://ui/hud/special_charge_hud.tscn" id="6_special_charge_hud"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="PlayerShape"]
|
||||
size = Vector2(65, 115)
|
||||
size = Vector2(41, 74)
|
||||
|
||||
[node name="Player" type="CharacterBody2D" groups=["player"]]
|
||||
[node name="Player" type="CharacterBody2D" unique_id=730885194 groups=["player"]]
|
||||
z_index = 1
|
||||
collision_layer = 2
|
||||
collision_mask = 1
|
||||
script = ExtResource("1_player")
|
||||
character_data = ExtResource("4_character")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0.5, 5.5)
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=589859800]
|
||||
shape = SubResource("PlayerShape")
|
||||
|
||||
[node name="Hurtbox" type="Area2D" parent="."]
|
||||
[node name="Hurtbox" type="Area2D" parent="." unique_id=542287926]
|
||||
collision_layer = 8
|
||||
collision_mask = 0
|
||||
monitoring = false
|
||||
monitorable = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"]
|
||||
position = Vector2(0.5, 5.5)
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox" unique_id=813209683]
|
||||
shape = SubResource("PlayerShape")
|
||||
|
||||
[node name="PunchHitbox" type="Area2D" parent="."]
|
||||
[node name="PunchHitbox" type="Area2D" parent="." unique_id=184501519]
|
||||
collision_layer = 0
|
||||
collision_mask = 16
|
||||
monitoring = true
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PunchHitbox"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="PunchHitbox" unique_id=126348432]
|
||||
|
||||
[node name="GroundPoundHitbox" type="Area2D" parent="."]
|
||||
[node name="GroundPoundHitbox" type="Area2D" parent="." unique_id=1822904824]
|
||||
collision_layer = 0
|
||||
collision_mask = 16
|
||||
monitoring = true
|
||||
monitorable = false
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundPoundHitbox"]
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="GroundPoundHitbox" unique_id=2120510285]
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1502470275]
|
||||
z_index = -1
|
||||
scale = Vector2(0.80251265, 0.8025128)
|
||||
scale = Vector2(0.56, 0.56)
|
||||
sprite_frames = ExtResource("2_frames")
|
||||
animation = &"idle"
|
||||
speed_scale = 2.0
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
scale = Vector2(0.5, 0.5)
|
||||
[node name="Camera2D" type="Camera2D" parent="." unique_id=902833396]
|
||||
zoom = Vector2(2, 2)
|
||||
script = ExtResource("3_camera")
|
||||
|
||||
[node name="PlayerHealthHUD" parent="." instance=ExtResource("5_health_hud")]
|
||||
[node name="PlayerHealthHUD" parent="." unique_id=660684564 instance=ExtResource("5_health_hud")]
|
||||
|
||||
[node name="SpecialChargeHUD" parent="." unique_id=1505444607 instance=ExtResource("6_special_charge_hud")]
|
||||
@@ -11,15 +11,12 @@ config_version=5
|
||||
[application]
|
||||
|
||||
config/name="Mortal Maze: The Game"
|
||||
run/main_scene="res://game/main.tscn"
|
||||
run/main_scene="res://levels/level_02.tscn"
|
||||
config/features=PackedStringArray("4.7", "GL Compatibility")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=1152
|
||||
window/size/viewport_height=648
|
||||
window/handheld/orientation=0
|
||||
window/stretch/mode="canvas_items"
|
||||
window/stretch/aspect="expand"
|
||||
|
||||
@@ -50,6 +47,16 @@ attack={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":74,"key_label":0,"unicode":106,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
ground_pound={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":75,"physical_keycode":75,"key_label":0,"unicode":107,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
special_attack={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":76,"physical_keycode":76,"key_label":0,"unicode":108,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
@@ -65,7 +72,7 @@ attack={
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/vram_compression/import_etc2_astc=true
|
||||
rendering_device/driver.windows="d3d12"
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
textures/vram_compression/import_etc2_astc=true
|
||||
@@ -0,0 +1,94 @@
|
||||
"""Static checks for the Android item test course (no Godot runtime needed).
|
||||
|
||||
Run from the project root: python -m unittest discover -s tests -v
|
||||
These tests check references and test-course configuration, not gameplay.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import re
|
||||
import unittest
|
||||
from xml.etree import ElementTree
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SCENE = ROOT / "levels/level_01.tscn"
|
||||
|
||||
|
||||
class Level01ConfigurationTests(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.scene = SCENE.read_text(encoding="utf-8")
|
||||
cls.resources = dict(
|
||||
re.findall(r'\[ext_resource [^\n]*path="res://([^"]+)" id="([^"]+)"\]', cls.scene)
|
||||
)
|
||||
# Format is path -> id; invert to follow ExtResource("item_N").
|
||||
cls.by_id = {resource_id: path for path, resource_id in cls.resources.items()}
|
||||
cls.stations = re.findall(
|
||||
r'\[node name="Station(\d{2})" parent="TestEnemies" instance=ExtResource\("(v\d+)"\)\]'
|
||||
r'\s*position = Vector2\(([\d.]+), ([\d.]+)\)'
|
||||
r'\s*guaranteed_drop = ExtResource\("(item_\d+)"\)',
|
||||
cls.scene,
|
||||
)
|
||||
|
||||
def test_seventeen_different_guaranteed_drops(self):
|
||||
self.assertEqual(len(self.stations), 17)
|
||||
self.assertEqual([s[0] for s in self.stations], [f"{i:02d}" for i in range(1, 18)])
|
||||
files = [self.by_id[station[4]] for station in self.stations]
|
||||
self.assertEqual(len(set(files)), 17)
|
||||
for path in files:
|
||||
self.assertTrue((ROOT / path).is_file(), path)
|
||||
|
||||
def test_enemy_variants_disable_respawn(self):
|
||||
self.assertEqual(len({station[1] for station in self.stations}), 5)
|
||||
for station in self.stations:
|
||||
scene_path = self.by_id[station[1]]
|
||||
enemy_scene = (ROOT / scene_path).read_text(encoding="utf-8")
|
||||
self.assertIn("respawn_delay = 0.0", enemy_scene)
|
||||
self.assertIn("chase_radius = 135.0", enemy_scene)
|
||||
|
||||
def test_floor_covers_all_encounters_and_finish(self):
|
||||
xs = [float(station[2]) for station in self.stations]
|
||||
self.assertEqual(xs, sorted(xs))
|
||||
self.assertTrue(all(0 <= x <= 8500 for x in xs))
|
||||
self.assertIn("size = Vector2(8500, 40)", self.scene)
|
||||
self.assertIn("position = Vector2(8180, 535)", self.scene)
|
||||
self.assertIn("camera.limit_right = LEVEL_WIDTH", (ROOT / "levels/level_01.gd").read_text())
|
||||
|
||||
def test_finish_and_death_areas_detect_player_layer(self):
|
||||
for area in ("FinishZone", "DeathZone"):
|
||||
definition = re.search(
|
||||
rf'\[node name="{area}" type="Area2D" parent="\."\](.*?)(?=\n\[node )',
|
||||
self.scene,
|
||||
re.S,
|
||||
)
|
||||
self.assertIsNotNone(definition)
|
||||
self.assertIn("collision_mask = 2", definition.group(1))
|
||||
|
||||
def test_every_enemy_svg_is_valid_and_present(self):
|
||||
folder = ROOT / "assets/enemies"
|
||||
sprites = sorted(folder.glob("*.svg"))
|
||||
self.assertEqual(len(sprites), 5)
|
||||
for svg in sprites:
|
||||
root = ElementTree.parse(svg).getroot()
|
||||
self.assertEqual(root.attrib["viewBox"], "0 0 32 56")
|
||||
self.assertTrue(len(root) > 20, svg.name)
|
||||
|
||||
def test_control_pickup_and_death_tracking_are_separate(self):
|
||||
# The independent control object distinguishes a rendering fault from
|
||||
# a death/drop fault without relying on running the Python test in Godot.
|
||||
self.assertIn('name="ControlPickup"', self.scene)
|
||||
self.assertIn('pickup_data = ExtResource("lab_control")', self.scene)
|
||||
self.assertTrue((ROOT / 'pickups/data/lab_control.tres').is_file())
|
||||
level_code = (ROOT / 'levels/level_01.gd').read_text(encoding='utf-8')
|
||||
enemy_code = (ROOT / 'enemies/walker/walker.gd').read_text(encoding='utf-8')
|
||||
self.assertIn('_process_station_deaths()', level_code)
|
||||
self.assertIn('enemy.get("is_dead")', level_code)
|
||||
self.assertIn('call_deferred("add_child", pickup)', level_code)
|
||||
self.assertIn('drops_handled_by_level', enemy_code)
|
||||
|
||||
def test_all_external_scene_references_exist(self):
|
||||
for path in self.resources:
|
||||
self.assertTrue((ROOT / path).is_file(), path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,83 @@
|
||||
"""Fast, engine-independent checks of the Level 02 alpha route.
|
||||
|
||||
Run: python -m unittest discover -s tests -v
|
||||
A Godot playtest is still needed for physics, importing, and Android controls.
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import re
|
||||
import unittest
|
||||
import struct
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
LEVEL = (ROOT / "levels/level_02.tscn").read_text(encoding="utf-8")
|
||||
SCRIPT = (ROOT / "levels/level_02.gd").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
class Level02ResourceTests(unittest.TestCase):
|
||||
def test_asset_references_exist(self):
|
||||
for path in re.findall(r'path="res://([^"]+)"', LEVEL):
|
||||
self.assertTrue((ROOT / path).is_file(), path)
|
||||
for asset in re.findall(r'preload\("res://([^"]+)"\)', SCRIPT):
|
||||
self.assertTrue((ROOT / asset).is_file(), asset)
|
||||
|
||||
def test_pixel_art_is_real_rgba_png_and_parallax_is_repeated(self):
|
||||
graphics = list((ROOT / "assets/city").glob("*.png"))
|
||||
self.assertEqual(len(graphics), 15)
|
||||
for png in graphics:
|
||||
content = png.read_bytes()
|
||||
self.assertTrue(content.startswith(b"\x89PNG\r\n\x1a\n"), png.name)
|
||||
width, height = struct.unpack(">II", content[16:24])
|
||||
self.assertGreater(width, 15)
|
||||
self.assertGreater(height, 15)
|
||||
self.assertEqual(LEVEL.count('type="Parallax2D"'), 4)
|
||||
self.assertEqual(LEVEL.count('repeat_size = Vector2(1024, 0)'), 4)
|
||||
self.assertIn('autoscroll = Vector2(3, 0)', LEVEL)
|
||||
self.assertIn('texture_repeat = 2', LEVEL)
|
||||
|
||||
def test_road_is_continuous_and_has_end_walls(self):
|
||||
widths = [float(w) for w in re.findall(
|
||||
r'\[sub_resource type="RectangleShape2D" id="Ground\d+"\]\nsize = Vector2\((\d+), 500\)', LEVEL
|
||||
)]
|
||||
# Each section uses a native CollisionShape2D with its own width.
|
||||
sections = re.findall(
|
||||
r'\[node name="Street\d+" type="CollisionShape2D" parent="World/Ground"\]\n'
|
||||
r'position = Vector2\((\d+(?:\.\d+)?), (\d+(?:\.\d+)?)\)\n'
|
||||
r'shape = SubResource\("Ground\d+"\)', LEVEL,
|
||||
)
|
||||
self.assertEqual(len(sections), 8)
|
||||
self.assertEqual(len(widths), len(sections))
|
||||
left_edge = 0
|
||||
tops = []
|
||||
for w, (center,y) in zip(widths, sections):
|
||||
self.assertEqual(float(center) - w / 2, left_edge)
|
||||
left_edge += w
|
||||
tops.append(float(y) - 250.0)
|
||||
self.assertEqual(left_edge, 11000)
|
||||
self.assertTrue(all(a-b <= 110 for a,b in zip(tops, tops[1:])), tops)
|
||||
for name in ('Left', 'Right'):
|
||||
self.assertRegex(LEVEL, rf'\[node name="{name}" type="CollisionShape2D" parent="World/Barriers"\]')
|
||||
self.assertIn('camera.limit_right = WORLD_WIDTH', SCRIPT)
|
||||
self.assertIn('collision_mask = 2', LEVEL)
|
||||
|
||||
def test_multiple_encounters_and_optional_items(self):
|
||||
enemies = re.findall(r'\[node name="Enemy\d+" parent="Enemies" instance=ExtResource\("enemy_([^\"]+)"\)\]', LEVEL)
|
||||
pickups = re.findall(r'\[node name="Pickup\d+" parent="Items" instance=ExtResource\("pickup"\)\]', LEVEL)
|
||||
self.assertEqual(len(enemies), 29)
|
||||
self.assertEqual(len(set(enemies)), 5)
|
||||
self.assertEqual(len(pickups), 14)
|
||||
self.assertEqual(LEVEL.count('one_way_collision = true'), 11)
|
||||
self.assertIn('run/main_scene="res://levels/level_02.tscn"', (ROOT / 'project.godot').read_text())
|
||||
self.assertIn('respawn_delay = 0.0', (ROOT / 'enemies/variants/roadie.tscn').read_text())
|
||||
|
||||
def test_50_hp_all_characters_and_12_point_ground_pound(self):
|
||||
for data in (ROOT / "player/characters").glob("*.tres"):
|
||||
self.assertIn('max_health = 50', data.read_text(), data.name)
|
||||
player = (ROOT / 'player/player.gd').read_text()
|
||||
self.assertIn('ground_pound_min_damage: int = 7', player)
|
||||
self.assertIn('ground_pound_max_damage: int = 12', player)
|
||||
self.assertIn('mini(\n\t\troundi(damage', player)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,83 @@
|
||||
extends SceneTree
|
||||
|
||||
## Godot integration smoke test. Engine required; not covered by Python tests.
|
||||
## Run after importing assets: godot --headless --path . --script res://tests/test_level_02_runtime.gd
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
||||
func _run() -> void:
|
||||
var packed: PackedScene = load("res://levels/level_02.tscn") as PackedScene
|
||||
if packed == null:
|
||||
_fail("No se pudo cargar levels/level_02.tscn")
|
||||
return
|
||||
|
||||
var level: Node2D = packed.instantiate() as Node2D
|
||||
root.add_child(level)
|
||||
current_scene = level
|
||||
await physics_frame
|
||||
|
||||
var player: CharacterBody2D = level.get_node("Player") as CharacterBody2D
|
||||
if player == null:
|
||||
_fail("No se ha instanciado el jugador")
|
||||
return
|
||||
var character_data: CharacterData = player.get("character_data") as CharacterData
|
||||
if character_data == null or character_data.max_health != 50:
|
||||
_fail("El jugador no inicia con los datos de 50 HP")
|
||||
return
|
||||
if int(player.get("current_health")) != 50:
|
||||
_fail("La vida inicial real no es 50")
|
||||
return
|
||||
if int(player.get("ground_pound_min_damage")) != 7 or int(player.get("ground_pound_max_damage")) != 12:
|
||||
_fail("El ground pound no esta configurado entre 7 y 12")
|
||||
return
|
||||
|
||||
var camera: Camera2D = player.get_node("Camera2D") as Camera2D
|
||||
if camera.limit_right != 11000:
|
||||
_fail("La camara todavia se detiene antes del final del mapa")
|
||||
return
|
||||
|
||||
if level.get_node("Enemies").get_child_count() != 29:
|
||||
_fail("No se instanciaron los 29 enemigos")
|
||||
return
|
||||
if level.get_node("Items").get_child_count() != 14:
|
||||
_fail("No se instanciaron los 14 objetos colocados")
|
||||
return
|
||||
|
||||
for node: Node in level.get_node("Items").get_children():
|
||||
var pickup: Pickup = node as Pickup
|
||||
if pickup == null or pickup.pickup_data == null or pickup.get_node("Sprite2D").texture == null:
|
||||
_fail("Pickup sin datos/icono: " + node.name)
|
||||
return
|
||||
|
||||
for name: String in ["Sky", "HighClouds", "FarBuildings", "NearBuildings"]:
|
||||
var layer: Parallax2D = level.get_node(name) as Parallax2D
|
||||
if layer == null or layer.repeat_size.x != 1024:
|
||||
_fail("Falta la capa de parallax repetible: " + name)
|
||||
return
|
||||
if (layer.get_node("Strip") as Sprite2D).texture == null:
|
||||
_fail("Falta la textura de la capa: " + name)
|
||||
return
|
||||
|
||||
if level.get_node("World/Ground").get_child_count() != 8:
|
||||
_fail("Numero incorrecto de calles")
|
||||
return
|
||||
if level.get_node("World/Walkways").get_child_count() != 11:
|
||||
_fail("Numero incorrecto de plataformas")
|
||||
return
|
||||
|
||||
# Las paredes son colisiones reales, no simples dibujos.
|
||||
var barriers: Node = level.get_node("World/Barriers")
|
||||
if barriers.get_child_count() != 2:
|
||||
_fail("Faltan las barreras de inicio y final")
|
||||
return
|
||||
|
||||
print("OK LEVEL02: escena, 50 HP, pound 7-12, 29 enemigos, 14 pickups, 4 parallax, calles, plataformas y barreras")
|
||||
quit(0)
|
||||
|
||||
|
||||
func _fail(message: String) -> void:
|
||||
push_error("Prueba runtime Level02: " + message)
|
||||
quit(1)
|
||||
@@ -0,0 +1,76 @@
|
||||
"""Validate Godot pickup resources before exporting Android.
|
||||
|
||||
Godot's serialized .tres files only accept Color(r, g, b, a) with numeric
|
||||
arguments. The GDScript syntax Color("#hex") is *not* valid here and caused
|
||||
all item data to fail to load (white squares named "Item").
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import re
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
DATA = ROOT / "pickups" / "data"
|
||||
NUM = r"[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?"
|
||||
COLOR = re.compile(rf'color\s*=\s*Color\(\s*({NUM})\s*,\s*({NUM})\s*,\s*({NUM})\s*,\s*({NUM})\s*\)')
|
||||
|
||||
|
||||
class PickupResourceTests(unittest.TestCase):
|
||||
def test_all_pickups_have_serializable_colors(self):
|
||||
resources = sorted(DATA.glob("*.tres"))
|
||||
self.assertEqual(len(resources), 18, "17 rewards plus one laboratory control")
|
||||
for path in resources:
|
||||
with self.subTest(path=path.name):
|
||||
content = path.read_text(encoding="utf-8")
|
||||
color = COLOR.search(content)
|
||||
self.assertIsNotNone(
|
||||
color,
|
||||
"A .tres color must use four numeric components, not Color('#hex')",
|
||||
)
|
||||
self.assertTrue(all(0.0 <= float(v) <= 1.0 for v in color.groups()))
|
||||
|
||||
def test_item_resources_have_valid_identifiers_names_and_images(self):
|
||||
names = set()
|
||||
for path in sorted(DATA.glob("*.tres")):
|
||||
with self.subTest(path=path.name):
|
||||
content = path.read_text(encoding="utf-8")
|
||||
identifier = re.search(r'^id = &"([^"]+)"$', content, re.M)
|
||||
title = re.search(r'^display_name = "([^"]+)"$', content, re.M)
|
||||
image = re.search(r'\[ext_resource type="Texture2D" path="res://([^"]+)"', content)
|
||||
self.assertIsNotNone(identifier)
|
||||
self.assertIsNotNone(title)
|
||||
self.assertIsNotNone(image)
|
||||
self.assertNotEqual(title.group(1), "Item")
|
||||
self.assertNotIn(identifier.group(1), names)
|
||||
names.add(identifier.group(1))
|
||||
self.assertTrue((ROOT / image.group(1)).is_file())
|
||||
|
||||
def test_runtime_pickups_detect_player_and_only_drops_have_a_delay(self):
|
||||
scene = (ROOT / "pickups/pickup.tscn").read_text(encoding="utf-8")
|
||||
pickup = (ROOT / "pickups/pickup.gd").read_text(encoding="utf-8")
|
||||
drop_manager = (ROOT / "pickups/drop_manager.gd").read_text(encoding="utf-8")
|
||||
laboratory = (ROOT / "levels/level_01.gd").read_text(encoding="utf-8")
|
||||
self.assertIn("collision_mask = 2", scene)
|
||||
self.assertIn("monitoring = true", scene)
|
||||
self.assertIn("@export var collection_delay_seconds: float = 0.0", pickup)
|
||||
self.assertIn("get_overlapping_bodies()", pickup)
|
||||
for code in (drop_manager, laboratory):
|
||||
self.assertIn("pickup.collection_delay_seconds = Pickup.DROP_COLLECTION_DELAY_SECONDS", code)
|
||||
|
||||
|
||||
def test_moving_across_a_drop_cannot_lose_the_pickup(self):
|
||||
pickup = (ROOT / "pickups" / "pickup.gd").read_text(encoding="utf-8")
|
||||
scene = (ROOT / "pickups" / "pickup.tscn").read_text(encoding="utf-8")
|
||||
player = (ROOT / "player" / "player.gd").read_text(encoding="utf-8")
|
||||
hud = (ROOT / "ui" / "hud" / "player_health_hud.gd").read_text(encoding="utf-8")
|
||||
|
||||
self.assertIn("_pending_collector", pickup, "Touches during the delay must be buffered")
|
||||
self.assertIn("for body in get_overlapping_bodies():", pickup, "Overlaps must be retried")
|
||||
self.assertIn("size = Vector2(28, 24)", scene, "Use a forgiving trigger without scaling the sprite")
|
||||
self.assertIn("func get_move_speed() -> float:", player)
|
||||
self.assertIn("direction * get_move_speed()", player)
|
||||
self.assertIn('player_ref.call("get_move_speed")', hud)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -0,0 +1,175 @@
|
||||
extends SceneTree
|
||||
|
||||
const PICKUP_SCENE: PackedScene = preload("res://pickups/pickup.tscn")
|
||||
|
||||
## Full Godot integration test. Requires the real engine and imported SVGs.
|
||||
## Run: godot --headless --path . --script res://tests/test_pickup_runtime.gd
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
call_deferred("_run")
|
||||
|
||||
|
||||
func _run() -> void:
|
||||
var packed_level: PackedScene = load("res://levels/level_01.tscn") as PackedScene
|
||||
if packed_level == null:
|
||||
_fail("No se pudo cargar level_01")
|
||||
return
|
||||
|
||||
var level: Node2D = packed_level.instantiate() as Node2D
|
||||
root.add_child(level)
|
||||
current_scene = level
|
||||
await process_frame
|
||||
|
||||
var status: Label = level.get_node("TestHUD/Overlay/Status") as Label
|
||||
if not status.text.contains("LAB DROPS v4"):
|
||||
_fail("No se esta ejecutando level_01.gd")
|
||||
return
|
||||
|
||||
# The pre-placed control pickup must work even without any enemy death.
|
||||
var control: Pickup = level.get_node("ControlPickup") as Pickup
|
||||
if control == null or control.pickup_data == null or control.pickup_data.id != &"lab_control":
|
||||
_fail("El pickup de control no se instancio")
|
||||
return
|
||||
if not control.visible or control.get_node("Sprite2D").texture == null:
|
||||
_fail("El pickup de control no tiene icono visible")
|
||||
return
|
||||
if control.get_node("Label").text != control.pickup_data.display_name:
|
||||
_fail("El nombre del pickup sigue siendo Item")
|
||||
return
|
||||
if not control.monitoring or not control.get("_can_collect"):
|
||||
_fail("Un objeto fijo debe ser recogible desde el primer instante")
|
||||
return
|
||||
|
||||
# Test a real collision, not a direct call to collect_pickup(). This used
|
||||
# to fail when monitoring was disabled while the player ran past the item.
|
||||
var player: CharacterBody2D = level.get_node("Player") as CharacterBody2D
|
||||
player.global_position = control.global_position
|
||||
await physics_frame
|
||||
await physics_frame
|
||||
await process_frame
|
||||
if is_instance_valid(control):
|
||||
_fail("El jugador ha tocado el objeto de control, pero no lo ha recogido")
|
||||
return
|
||||
if int(player.get("_shield_hits")) < 1:
|
||||
_fail("El efecto de escudo del objeto de control no se aplico")
|
||||
return
|
||||
if level.collected_items.size() != 0:
|
||||
_fail("El objeto de control no debe contar entre los 17 drops")
|
||||
return
|
||||
|
||||
# Touch a dropped speed item while the 0.75-second collection delay is
|
||||
# running, then move away as if running through it. It must not be lost.
|
||||
var base_speed: float = float(player.call("get_move_speed"))
|
||||
var speed_drop: Pickup = PICKUP_SCENE.instantiate() as Pickup
|
||||
speed_drop.pickup_data = load("res://pickups/data/coffee.tres") as PickupData
|
||||
speed_drop.collection_delay_seconds = Pickup.DROP_COLLECTION_DELAY_SECONDS
|
||||
speed_drop.position = player.position
|
||||
level.add_child(speed_drop)
|
||||
await create_timer(0.1).timeout
|
||||
if not is_instance_valid(speed_drop) or speed_drop.get("_pending_collector") != player:
|
||||
_fail("El jugador no se registro al atravesar el drop durante la espera")
|
||||
return
|
||||
player.global_position = Vector2(170, 557)
|
||||
await create_timer(0.8).timeout
|
||||
if is_instance_valid(speed_drop):
|
||||
_fail("El drop tocado durante la espera se quedo olvidado en el suelo")
|
||||
return
|
||||
if not is_equal_approx(float(player.call("get_move_speed")), base_speed * 1.25):
|
||||
_fail("El Tostado del Averno no ha aumentado la velocidad un 25%%")
|
||||
return
|
||||
|
||||
# The multiplier must affect actual horizontal movement, not just a label.
|
||||
Input.action_press("move_right")
|
||||
await create_timer(0.3).timeout
|
||||
Input.action_release("move_right")
|
||||
if player.velocity.x < base_speed * 1.15:
|
||||
_fail("La velocidad horizontal real no refleja el buff de velocidad")
|
||||
return
|
||||
player.velocity = Vector2.ZERO
|
||||
player.global_position = Vector2(170, 557)
|
||||
await create_timer(0.15).timeout
|
||||
|
||||
# A full-health heal should stay on the floor, then get collected without
|
||||
# requiring a second body_entered signal when HP decreases in place.
|
||||
var heal_pickup: Pickup = PICKUP_SCENE.instantiate() as Pickup
|
||||
heal_pickup.pickup_data = load("res://pickups/data/beer.tres") as PickupData
|
||||
heal_pickup.position = player.position
|
||||
level.add_child(heal_pickup)
|
||||
await create_timer(0.1).timeout
|
||||
if not is_instance_valid(heal_pickup):
|
||||
_fail("Un objeto de curacion no debe consumirse con HP al maximo")
|
||||
return
|
||||
if not (heal_pickup.get_node("Label") as Label).text.contains("HP LLENO"):
|
||||
_fail("El pickup no explica que la salud esta llena")
|
||||
return
|
||||
player.set("current_health", 20)
|
||||
await create_timer(0.1).timeout
|
||||
if is_instance_valid(heal_pickup) or int(player.get("current_health")) <= 20:
|
||||
_fail("Un objeto solapado debe reintentarse cuando el jugador necesita HP")
|
||||
return
|
||||
|
||||
var enemies: Array[Node] = level.get_node("TestEnemies").get_children()
|
||||
if enemies.size() != 17:
|
||||
_fail("Se esperaban 17 enemigos, hay %d" % enemies.size())
|
||||
return
|
||||
|
||||
var expected_ids: Dictionary = {}
|
||||
for enemy in enemies:
|
||||
var data: PickupData = enemy.get("guaranteed_drop") as PickupData
|
||||
if data == null or not bool(enemy.get("drops_handled_by_level")):
|
||||
_fail("Configuracion de drop incorrecta: %s" % enemy.name)
|
||||
return
|
||||
expected_ids[data.id] = true
|
||||
|
||||
# Simulate a missed signal for station 01. The polling of is_dead must
|
||||
# still register its KO and create the guaranteed drop.
|
||||
var lab_callback: Callable = Callable(level, "_on_station_enemy_died")
|
||||
enemies[0].disconnect(&"died", lab_callback)
|
||||
for enemy in enemies:
|
||||
enemy.call("take_damage", int(enemy.get("max_health")), Vector2.ZERO)
|
||||
|
||||
await create_timer(0.25).timeout
|
||||
if level.defeated_enemies != 17 or level.spawned_drops != 17:
|
||||
_fail("KO/drops incorrectos: %d KOs, %d drops" % [level.defeated_enemies, level.spawned_drops])
|
||||
return
|
||||
if level.death_signals != 16:
|
||||
_fail("Se esperaban 16 senales despues de desconectar una, hay %d" % level.death_signals)
|
||||
return
|
||||
|
||||
var pickups: Array[Node] = get_nodes_in_group("pickup")
|
||||
if pickups.size() != 17:
|
||||
_fail("Se esperaban 17 drops; el control ya se ha recogido. Hay %d" % pickups.size())
|
||||
return
|
||||
|
||||
var actual_ids: Dictionary = {}
|
||||
for node in pickups:
|
||||
var pickup: Pickup = node as Pickup
|
||||
if pickup == null or pickup.pickup_data == null or not pickup.visible:
|
||||
_fail("Hay un pickup invalido o invisible")
|
||||
return
|
||||
if pickup.get_node("Sprite2D").texture == null:
|
||||
_fail("Pickup sin icono: %s" % pickup.pickup_data.id)
|
||||
return
|
||||
if not pickup.monitoring or bool(pickup.get("_can_collect")):
|
||||
_fail("El drop debe detectar solapes, pero esperar 0.75 s para recogerse: %s" % pickup.pickup_data.id)
|
||||
return
|
||||
if pickup.pickup_data.id != &"lab_control":
|
||||
actual_ids[pickup.pickup_data.id] = true
|
||||
|
||||
if actual_ids != expected_ids:
|
||||
_fail("Los 17 drops no corresponden a las estaciones")
|
||||
return
|
||||
|
||||
await create_timer(0.2).timeout
|
||||
if get_nodes_in_group("pickup").size() != 17:
|
||||
_fail("Se duplicaron o perdieron drops al procesar frames adicionales")
|
||||
return
|
||||
|
||||
print("OK LAB DROPS: colision, paso rapido, reintento de curacion, velocidad real, 17 KOs y 17 drops")
|
||||
quit(0)
|
||||
|
||||
|
||||
func _fail(message: String) -> void:
|
||||
push_error("Prueba runtime de pickups: " + message)
|
||||
quit(1)
|
||||
@@ -0,0 +1,216 @@
|
||||
"""Regenerate Level 02's original pixel-art PNGs with Pillow.
|
||||
|
||||
Usage: python tools/generate_city_art.py
|
||||
Only development-time Pillow is required. Godot uses the exported PNGs directly.
|
||||
Everything is drawn on a low-resolution pixel grid, then resized with NEAREST.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
from pathlib import Path
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1] / 'assets' / 'city'
|
||||
ROOT.mkdir(parents=True, exist_ok=True)
|
||||
SCALE = 2
|
||||
W, H = 512, 640 # 1024x1280 world units after nearest-neighbour enlargement.
|
||||
INK = '#171d31'
|
||||
SKY = ['#181e38', '#242844', '#32334f', '#4d4159', '#67505d']
|
||||
FAR = ['#2b3048', '#30354e', '#353a53', '#3c3c54']
|
||||
MID = ['#424358', '#4b495e', '#545065', '#5c5265']
|
||||
NEAR = ['#51546a', '#5b576d', '#64596d', '#656273', '#565b70']
|
||||
WINDOW_DARK = ['#292f47', '#34384c', '#373a50']
|
||||
WINDOW_LIT = ['#e5b878', '#edcf91', '#ad9da0', '#ae8e78']
|
||||
FONT_PATH = Path(__file__).resolve().parents[1] / 'assets' / 'fonts' / 'PixelOperator8.ttf'
|
||||
|
||||
|
||||
def image(mode='RGBA'):
|
||||
return Image.new(mode, (W, H), (0, 0, 0, 0))
|
||||
|
||||
|
||||
def save(img, name, multiplier=SCALE):
|
||||
img.resize((img.width * multiplier, img.height * multiplier), Image.Resampling.NEAREST).save(ROOT / name, optimize=True)
|
||||
|
||||
|
||||
def blocks(d, x0, y0, x1, y1, fill, highlight=None, shadow=None):
|
||||
d.rectangle((x0, y0, x1, y1), fill=fill)
|
||||
if shadow:
|
||||
d.rectangle((x1 - 3, y0 + 3, x1, y1), fill=shadow)
|
||||
if highlight:
|
||||
d.rectangle((x0 + 2, y0 + 2, x1 - 5, y0 + 4), fill=highlight)
|
||||
|
||||
|
||||
def windows(d, x0, top, x1, bottom, rng, lit_probability, tiny=False):
|
||||
ww, wh = (3, 6) if tiny else (7, 10)
|
||||
dx, dy = (12, 16) if tiny else (19, 23)
|
||||
for yy in range(top + 20, bottom - wh - 15, dy):
|
||||
for xx in range(x0 + 9, x1 - ww - 6, dx):
|
||||
if rng.random() > .90:
|
||||
continue
|
||||
color = rng.choice(WINDOW_LIT) if rng.random() < lit_probability else rng.choice(WINDOW_DARK)
|
||||
d.rectangle((xx, yy, xx + ww, yy + wh), fill=color)
|
||||
if not tiny:
|
||||
d.line((xx + ww // 2, yy, xx + ww // 2, yy + wh), fill='#404057', width=2)
|
||||
d.rectangle((xx - 1, yy + wh + 1, xx + ww + 1, yy + wh + 2), fill='#35384c')
|
||||
|
||||
|
||||
# The base is fully opaque. No transparent gaps appear while jumping high.
|
||||
sky = Image.new('RGB', (W, H), SKY[-1]); d = ImageDraw.Draw(sky)
|
||||
for yy in range(H):
|
||||
s = yy / H
|
||||
stops = [0, .24, .47, .7, 1]
|
||||
for i in range(4):
|
||||
if stops[i] <= s <= stops[i + 1]:
|
||||
t = (s - stops[i]) / (stops[i + 1] - stops[i])
|
||||
ca = tuple(bytes.fromhex(SKY[i][1:])); cb = tuple(bytes.fromhex(SKY[i+1][1:]))
|
||||
rgb = tuple(round(a * (1 - t) + b * t) for a,b in zip(ca,cb))
|
||||
d.line((0,yy,W,yy),fill=rgb)
|
||||
break
|
||||
rng = random.Random(8173)
|
||||
for i in range(110):
|
||||
x,y = rng.randrange(W), rng.randrange(0,275)
|
||||
color = rng.choice(('#aaafc8','#888fad','#797f9d'))
|
||||
d.rectangle((x,y,x+(i%19==0),y+(i%23==0)),fill=color)
|
||||
# Offset glow and a pale disk: deliberately subdued so it never steals focus.
|
||||
for rad, col in [(55,'#524b69'), (42,'#655a74'),(30,'#847588'),(22,'#c2a39e')]:
|
||||
d.ellipse((410-rad,178-rad,410+rad,178+rad), fill=col)
|
||||
save(sky,'sky.png')
|
||||
|
||||
|
||||
# Cloud silhouettes: one independent, slowly drifting parallax layer.
|
||||
clouds = image(); d=ImageDraw.Draw(clouds); rng=random.Random(97)
|
||||
for cx,cy,rw,rh in [(90,218,65,18),(300,340,82,19),(482,280,55,17),(196,419,67,17)]:
|
||||
for k in range(9):
|
||||
x = cx - rw + k * rw // 4
|
||||
by = cy + rng.randint(-4,4)
|
||||
radius = rng.randint(rh-4,rh+8)
|
||||
d.rectangle((x,by-radius//2,x+rw//4+15,by+rh),fill='#48465d')
|
||||
d.ellipse((x,by-radius,x+2*radius,by+radius),fill='#55516a')
|
||||
d.rectangle((cx-rw+12,cy+rh,cx+rw+4,cy+rh+6), fill='#4e4c63')
|
||||
for ii in range(4):
|
||||
xx=cx-rw+25+ii*rw//3
|
||||
d.rectangle((xx,cy+rh-3,xx+18,cy+rh-1),fill='#79738b')
|
||||
save(clouds,'clouds.png')
|
||||
|
||||
|
||||
# Silhouette skyline: repeatable at the 1024-unit horizontal seam.
|
||||
far=image(); d=ImageDraw.Draw(far); rng=random.Random(190)
|
||||
x=0
|
||||
while x<W:
|
||||
ww=rng.randint(28,61); y=rng.randint(274,402); xx=min(W-1,x+ww)
|
||||
color=rng.choice(FAR)
|
||||
blocks(d,x,y,xx,H,color,highlight='#44445e',shadow='#292b42')
|
||||
windows(d,x,y,xx,H,rng,.14,tiny=True)
|
||||
if rng.random()<.35:
|
||||
d.rectangle((x+ww//2,y-18,x+ww//2+2,y+1),fill='#66657c')
|
||||
d.rectangle((x+ww//2-8,y-1,x+ww//2+9,y+1),fill='#66657c')
|
||||
x=xx+1
|
||||
save(far,'skyline_far.png')
|
||||
|
||||
|
||||
# Mid-range neighbourhood: roofs, gutters, some illuminated windows.
|
||||
mid=image(); d=ImageDraw.Draw(mid); rng=random.Random(317)
|
||||
x=0
|
||||
while x<W:
|
||||
ww=rng.randrange(65,121); y=rng.randrange(320,448); xx=min(W-1,x+ww)
|
||||
color=rng.choice(MID)
|
||||
blocks(d,x,y,xx,H,color,highlight='#777084',shadow='#39394f')
|
||||
d.rectangle((x-2,y-7,xx+3,y),fill='#252b42')
|
||||
d.rectangle((x+5,y-12,x+17,y-8),fill='#363b50')
|
||||
windows(d,x,y,xx,H,rng,.34)
|
||||
# Awnings and air-conditioning boxes establish a recognisable city profile.
|
||||
if ww>85:
|
||||
d.rectangle((x+ww//2-15,y-17,x+ww//2+23,y-8),fill='#36394e')
|
||||
d.rectangle((x+ww//2-12,y-24,x+ww//2+20,y-18),fill='#5f6074')
|
||||
x=xx+1
|
||||
save(mid,'skyline_mid.png')
|
||||
|
||||
|
||||
# Facades are separate reusable transparent PNGs. They can be moved individually
|
||||
# in the level editor without needing to regenerate a single huge background.
|
||||
font=ImageFont.truetype(str(FONT_PATH), 11) if FONT_PATH.exists() else ImageFont.load_default()
|
||||
styles=[
|
||||
('SALA RUIDO', 108, 245, '#565369', '#8f596a'),
|
||||
('GIRA 24H', 94, 207, '#5d5871', '#666e81'),
|
||||
('NOISE SHOP', 132, 272, '#595b70', '#7a586e'),
|
||||
('LOCAL 404', 112, 223, '#625969', '#af766a'),
|
||||
('THRASH FM', 139, 295, '#56596e', '#73778e'),
|
||||
('REHEARSAL', 120, 257, '#5d566e', '#86717c'),
|
||||
]
|
||||
for idx,(sign,bw,bh,main,accent) in enumerate(styles):
|
||||
rng=random.Random(900+idx); img=Image.new('RGBA',(bw,bh),(0,0,0,0)); dd=ImageDraw.Draw(img)
|
||||
# Main mass and pixel masonry.
|
||||
dd.rectangle((3,11,bw-3,bh-1),fill=main)
|
||||
dd.rectangle((0,7,bw-1,13),fill='#30364b')
|
||||
dd.rectangle((4,14,bw-6,17),fill='#787388')
|
||||
for yy in range(25,bh-19,12):
|
||||
for xx in range(7+(yy//12%2)*5,bw-7,19):
|
||||
dd.line((xx, yy,xx+11,yy),fill='#6a657a',width=1)
|
||||
windows(dd,2,15,bw-3,bh,rng,.45)
|
||||
# Shop front, rolling shutters, and a neon venue sign.
|
||||
dd.rectangle((8,bh-49,bw-9,bh-2),fill='#30344b')
|
||||
dd.rectangle((bw//2-15,bh-45,bw//2+14,bh-3),fill='#515064')
|
||||
dd.rectangle((bw//2-12,bh-43,bw//2+11,bh-6),fill='#242a40')
|
||||
dd.line((bw//2,bh-42,bw//2,bh-6),fill='#81798d',width=2)
|
||||
signw=min(bw-13, len(sign)*7 + 10)
|
||||
lx=(bw-signw)//2
|
||||
dd.rectangle((lx,28,lx+signw,49), fill='#242a41')
|
||||
dd.rectangle((lx+2,30,lx+signw-2,47), outline=accent, width=2)
|
||||
if signw>20:
|
||||
bbox=dd.textbbox((0,0),sign,font=font)
|
||||
tw=bbox[2]-bbox[0]
|
||||
# Pixel text is clipped intentionally if a deliberately long sign occurs.
|
||||
dd.text(((bw-tw)//2,32),sign,font=font,fill='#f7ca85')
|
||||
# Vent pipe, satellite/radio antenna, fire exit.
|
||||
dd.rectangle((bw-20,1,bw-16,11),fill='#31384d')
|
||||
dd.rectangle((bw-26,1,bw-9,3),fill='#747082')
|
||||
dd.rectangle((bw-10,bh//2,bw-4,bh//2+41),fill='#3a4056')
|
||||
for yy in range(bh//2,bh//2+41,10):
|
||||
dd.line((bw-17,yy,bw-3,yy),fill='#777a8a',width=2)
|
||||
save(img,f'facade_{idx+1:02d}.png')
|
||||
|
||||
|
||||
# Game terrain tiles, also authored pixel-by-pixel. Each is seamless in X/Y.
|
||||
road=Image.new('RGBA',(64,64),'#292f40');d=ImageDraw.Draw(road);rng=random.Random(87)
|
||||
for gy in range(0,64,16):
|
||||
for gx in range(0,64,32):
|
||||
xx=gx+((gy//16)%2)*12
|
||||
d.line((xx,gy,xx+27,gy),fill='#3c4153',width=2)
|
||||
d.line((xx+2,gy+3,xx+2,gy+15),fill='#21283a')
|
||||
for i in range(33):
|
||||
x,y=rng.randrange(64),rng.randrange(64)
|
||||
d.rectangle((x,y,x+rng.randint(1,3),y+1),fill=rng.choice(('#3b3f50','#242b3a','#414456')))
|
||||
save(road,'asphalt.png')
|
||||
|
||||
curb=Image.new('RGBA',(64,12),'#777484'); d=ImageDraw.Draw(curb)
|
||||
d.rectangle((0,0,63,2),fill='#aea1a0');d.rectangle((0,3,63,6),fill='#8d8894');d.rectangle((0,9,63,11),fill='#3c4054')
|
||||
d.line((31,4,31,10),fill='#47495b',width=2)
|
||||
save(curb,'curb.png')
|
||||
|
||||
pl=Image.new('RGBA',(64,12),'#51566c'); d=ImageDraw.Draw(pl)
|
||||
d.rectangle((0,0,63,2),fill='#bab4b3');d.rectangle((0,3,63,8),fill='#74798b')
|
||||
d.rectangle((0,9,63,11),fill='#30374d')
|
||||
for x in (4,27,50):
|
||||
d.rectangle((x,4,x+3,7), fill='#292f43')
|
||||
save(pl,'walkway.png')
|
||||
|
||||
barrier=Image.new('RGBA',(24,80),'#303447'); d=ImageDraw.Draw(barrier)
|
||||
d.rectangle((0,0,23,3),fill='#e9be83')
|
||||
d.rectangle((2,6,21,77),fill='#444958')
|
||||
for y in (13,34,55):
|
||||
d.polygon([(2,y),(12,y-10),(22,y-10),(22,y-3),(9,y+6),(2,y+6)], fill='#b77e63')
|
||||
d.rectangle((0,77,23,79),fill='#202838')
|
||||
save(barrier,'barrier.png')
|
||||
|
||||
# A compact pavement prop, reused sparingly in the actual scene.
|
||||
lamp=Image.new('RGBA',(48,176),(0,0,0,0));d=ImageDraw.Draw(lamp)
|
||||
d.rectangle((25,27,28,175),fill='#373e56')
|
||||
d.rectangle((17,24,34,31),fill='#4f5267')
|
||||
d.rectangle((7,11,43,20),fill='#2b344a')
|
||||
d.rectangle((9,13,40,18),fill='#e4bd83')
|
||||
d.rectangle((13,20,36,25),fill='#676579')
|
||||
d.rectangle((19,172,35,175),fill='#353b4d')
|
||||
save(lamp,'streetlamp.png')
|
||||
|
||||
print(f'Generated {len(list(ROOT.glob("*.png")))} original PNG assets in {ROOT}')
|
||||
@@ -10,17 +10,50 @@ extends CanvasLayer
|
||||
|
||||
@onready var health_bar: ProgressBar = $HUD/HealthBar
|
||||
@onready var health_label: Label = $HUD/HealthBar/HealthLabel
|
||||
@onready var effects_label: Label = $HUD/EffectsLabel
|
||||
|
||||
var player_ref: Node
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var player: Node = get_parent()
|
||||
if player == null or not player.has_signal(&"health_changed"):
|
||||
push_error("PlayerHealthHUD must be a child of a Player with health_changed signal.")
|
||||
player_ref = get_parent()
|
||||
if not player_ref.has_signal(&"health_changed"):
|
||||
push_error("PlayerHealthHUD must be a child of a Player.")
|
||||
return
|
||||
# Children enter _ready before Player. Its initial signal arrives afterward.
|
||||
player_ref.connect(&"health_changed", _on_health_changed)
|
||||
effects_label.visible = false
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if player_ref == null:
|
||||
return
|
||||
|
||||
# Child _ready() runs before Player._ready(). We connect here first and the
|
||||
# Player will emit its initial health value a moment later during its _ready().
|
||||
player.connect(&"health_changed", _on_health_changed)
|
||||
# Display each active effect individually: essential when validating all
|
||||
# eight pickup families on a phone. Property names match Player's timers.
|
||||
var active: Array[String] = []
|
||||
var speed_seconds: float = float(player_ref.get("_speed_boost_timer"))
|
||||
if speed_seconds > 0.0:
|
||||
var bonus_percent: int = roundi(float(player_ref.get("_speed_boost_multiplier")) * 100.0)
|
||||
var speed: int = roundi(float(player_ref.call("get_move_speed")))
|
||||
active.append("VEL +%d%% | %d px/s | %ds" % [bonus_percent, speed, ceili(speed_seconds)])
|
||||
|
||||
for effect in [
|
||||
["DANO", "_damage_boost_timer"],
|
||||
["GOLPE AEREO", "_air_damage_boost_timer"],
|
||||
["DEFENSA", "_damage_reduction_timer"],
|
||||
["SALTO", "_jump_boost_timer"],
|
||||
]:
|
||||
var seconds: float = float(player_ref.get(effect[1]))
|
||||
if seconds > 0.0:
|
||||
active.append("%s: %ds" % [effect[0], ceili(seconds)])
|
||||
|
||||
var shield_hits: int = int(player_ref.get("_shield_hits"))
|
||||
if shield_hits > 0:
|
||||
active.append("ESCUDO: %d golpe(s)" % shield_hits)
|
||||
|
||||
effects_label.visible = not active.is_empty()
|
||||
effects_label.text = "\n".join(active)
|
||||
|
||||
|
||||
func _on_health_changed(current_health: int, max_health: int) -> void:
|
||||
|
||||
@@ -63,3 +63,17 @@ theme_override_font_sizes/font_size = 18
|
||||
text = "HP 5 / 5"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="EffectsLabel" type="Label" parent="HUD"]
|
||||
layout_mode = 0
|
||||
offset_left = 18.0
|
||||
offset_top = 106.0
|
||||
offset_right = 298.0
|
||||
offset_bottom = 255.0
|
||||
theme_override_colors/font_color = Color(1, 0.8, 0.2, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.9)
|
||||
theme_override_font_sizes/font_size = 16
|
||||
text = "VELOCIDAD: 0s"
|
||||
horizontal_alignment = 0
|
||||
vertical_alignment = 0
|
||||
visible = false
|
||||
@@ -0,0 +1,28 @@
|
||||
extends CanvasLayer
|
||||
|
||||
|
||||
## Minimal HUD showing the player's special attack charge.
|
||||
##
|
||||
## Expects to be a child of a Player that exposes a `special_charge_changed`
|
||||
## signal, just like PlayerHealthHUD expects `health_changed`.
|
||||
|
||||
|
||||
@onready var special_bar: ProgressBar = $HUD/SpecialBar
|
||||
@onready var special_label: Label = $HUD/SpecialBar/SpecialLabel
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
var player: Node = get_parent()
|
||||
if player == null or not player.has_signal(&"special_charge_changed"):
|
||||
push_error("SpecialChargeHUD must be a child of a Player with special_charge_changed signal.")
|
||||
return
|
||||
|
||||
# Child _ready() runs before Player._ready(). We connect here first and the
|
||||
# Player will emit its initial charge a moment later during its _ready().
|
||||
player.connect(&"special_charge_changed", _on_special_charge_changed)
|
||||
|
||||
|
||||
func _on_special_charge_changed(current_charge: int, max_charge: int) -> void:
|
||||
special_bar.max_value = float(max_charge)
|
||||
special_bar.value = float(current_charge)
|
||||
special_label.text = "SPECIAL %d%%" % [current_charge]
|
||||
@@ -0,0 +1,37 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/hud/special_charge_hud.gd" id="1_hud"]
|
||||
|
||||
[node name="SpecialChargeHUD" type="CanvasLayer"]
|
||||
layer = 95
|
||||
script = ExtResource("1_hud")
|
||||
|
||||
[node name="HUD" type="Control" parent="."]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="SpecialBar" type="ProgressBar" parent="HUD"]
|
||||
offset_left = 18.0
|
||||
offset_top = 74.0
|
||||
offset_right = 278.0
|
||||
offset_bottom = 94.0
|
||||
max_value = 100.0
|
||||
value = 0.0
|
||||
show_percentage = false
|
||||
|
||||
[node name="SpecialLabel" type="Label" parent="HUD/SpecialBar"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
offset_left = 4.0
|
||||
offset_top = 2.0
|
||||
text = "SPECIAL"
|
||||
theme_override_colors/font_color = Color(1, 1, 1, 1)
|
||||
theme_override_colors/font_shadow_color = Color(0, 0, 0, 0.9)
|
||||
theme_override_constants/shadow_offset_x = 1
|
||||
theme_override_constants/shadow_offset_y = 1
|
||||
theme_override_font_sizes/font_size = 14
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -18,6 +18,8 @@ extends CanvasLayer
|
||||
@onready var move_right_button: Button = $Controls/MoveRight
|
||||
@onready var jump_button: Button = $Controls/Jump
|
||||
@onready var attack_button: Button = $Controls/Attack
|
||||
@onready var ground_pound_button: Button = $Controls/GroundPound
|
||||
@onready var special_attack_button: Button = $Controls/SpecialAttack
|
||||
|
||||
var direction_touch_index: int = -1
|
||||
|
||||
@@ -25,6 +27,8 @@ var direction_touch_index: int = -1
|
||||
func _ready() -> void:
|
||||
_bind_button(jump_button, &"jump")
|
||||
_bind_button(attack_button, &"attack")
|
||||
_bind_button(ground_pound_button, &"ground_pound")
|
||||
_bind_button(special_attack_button, &"special_attack")
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
@@ -53,6 +57,8 @@ func _exit_tree() -> void:
|
||||
Input.action_release(&"move_right")
|
||||
Input.action_release(&"jump")
|
||||
Input.action_release(&"attack")
|
||||
Input.action_release(&"ground_pound")
|
||||
Input.action_release(&"special_attack")
|
||||
|
||||
|
||||
func _direction_at(position: Vector2) -> StringName:
|
||||
|
||||