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
+1
View File
@@ -40,6 +40,7 @@ skin = "native"
-- colors.escala = COLOR_LIGHT_CYAN -- ═ escales -- colors.escala = COLOR_LIGHT_CYAN -- ═ escales
-- colors.corda = COLOR_LIGHT_GRAY -- ─ cordes -- colors.corda = COLOR_LIGHT_GRAY -- ─ cordes
-- colors.pepe = COLOR_WHITE -- el protagonista -- colors.pepe = COLOR_WHITE -- el protagonista
-- colors.pepe_invuln = COLOR_LIGHT_GREEN -- parpadeig en invulnerabilitat
-- colors.malo = COLOR_LIGHT_RED -- enemics -- colors.malo = COLOR_LIGHT_RED -- enemics
-- colors.malo_carrega = COLOR_LIGHT_MAGENTA -- enemic portant diners -- colors.malo_carrega = COLOR_LIGHT_MAGENTA -- enemic portant diners
-- colors.hud_text = COLOR_WHITE -- text del rotul inferior -- colors.hud_text = COLOR_WHITE -- text del rotul inferior
+9 -2
View File
@@ -76,6 +76,7 @@ colors = {
escala = COLOR_LIGHT_CYAN, escala = COLOR_LIGHT_CYAN,
corda = COLOR_LIGHT_GRAY, corda = COLOR_LIGHT_GRAY,
pepe = COLOR_WHITE, pepe = COLOR_WHITE,
pepe_invuln = COLOR_LIGHT_GREEN, -- parpadeig de Pepe quan es invulnerable
malo = COLOR_LIGHT_RED, malo = COLOR_LIGHT_RED,
malo_carrega = COLOR_LIGHT_MAGENTA, -- enemic portant diners malo_carrega = COLOR_LIGHT_MAGENTA, -- enemic portant diners
hud_text = COLOR_WHITE, hud_text = COLOR_WHITE,
@@ -277,6 +278,8 @@ end
-- ==================================================================== -- ====================================================================
function sfx_coin() sound(2000, 40) end function sfx_coin() sound(2000, 40) end
function sfx_escala_step(y) sound(400 + y * 40, 4) 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_dig() play("l0o2c") end
function sfx_die() play("l1o4cl0o3bagfed") end function sfx_die() play("l1o4cl0o3bagfed") end
function sfx_malo_die() play("l0o3ao4c") 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 col = ((fase - tram_curt) % 12 < 6) and colors.malo or colors.bg
end end
elseif pepe.invuln_t > 0 then elseif pepe.invuln_t > 0 then
-- Invulnerabilitat: parpadeja entre blanc i groc cada 6 frames. -- Invulnerabilitat: parpadeja entre colors.pepe i colors.pepe_invuln
col = (pepe.invuln_t % 12 < 6) and colors.pepe or colors.diners -- 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 end
color(col, colors.bg) color(col, colors.bg)
@@ -471,6 +477,7 @@ function respawn_pepe()
pepe.y = 23 pepe.y = 23
pepe.estat = NORMAL pepe.estat = NORMAL
pepe.invuln_t = temps.invuln_frames pepe.invuln_t = temps.invuln_frames
sfx_respawn()
end end
-- Inicialitza tot per a una nova partida (reset complet) -- Inicialitza tot per a una nova partida (reset complet)