DX: sfx de respawn i color de parpadeig d'invulnerabilitat configurable

This commit is contained in:
2026-05-15 18:06:22 +02:00
parent 8f8d71afcd
commit 5b3b0b3f6a
2 changed files with 10 additions and 2 deletions
+9 -2
View File
@@ -76,6 +76,7 @@ colors = {
escala = COLOR_LIGHT_CYAN,
corda = COLOR_LIGHT_GRAY,
pepe = COLOR_WHITE,
pepe_invuln = COLOR_LIGHT_GREEN, -- parpadeig de Pepe quan es invulnerable
malo = COLOR_LIGHT_RED,
malo_carrega = COLOR_LIGHT_MAGENTA, -- enemic portant diners
hud_text = COLOR_WHITE,
@@ -277,6 +278,8 @@ end
-- ====================================================================
function sfx_coin() sound(2000, 40) end
function sfx_escala_step(y) sound(400 + y * 40, 4) end
-- "uic uic uic..." quatre pulsos aguts amb volum decreixent, com un eco
function sfx_respawn() play("o6v9c0r0v6c0r0v3c0r0v1c0") end
function sfx_dig() play("l0o2c") end
function sfx_die() play("l1o4cl0o3bagfed") end
function sfx_malo_die() play("l0o3ao4c") end
@@ -362,8 +365,11 @@ function pintar_pepe()
col = ((fase - tram_curt) % 12 < 6) and colors.malo or colors.bg
end
elseif pepe.invuln_t > 0 then
-- Invulnerabilitat: parpadeja entre blanc i groc cada 6 frames.
col = (pepe.invuln_t % 12 < 6) and colors.pepe or colors.diners
-- Invulnerabilitat: parpadeja entre colors.pepe i colors.pepe_invuln
-- cada 6 frames. Es vol un color brillant per a que no quede estela
-- visual al moure's (negre o foscos donen la sensacio que la silueta
-- blanca persisteix en la retina).
col = (pepe.invuln_t % 12 < 6) and colors.pepe or colors.pepe_invuln
end
color(col, colors.bg)
@@ -471,6 +477,7 @@ function respawn_pepe()
pepe.y = 23
pepe.estat = NORMAL
pepe.invuln_t = temps.invuln_frames
sfx_respawn()
end
-- Inicialitza tot per a una nova partida (reset complet)