DX: skins externalitzades a skins/<nom>.lua amb sprites propis
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 138 B |
Binary file not shown.
+10
-38
@@ -7,47 +7,19 @@
|
||||
-- ASPECTE GRAFIC
|
||||
-- ====================================================================
|
||||
|
||||
-- Skin: quina familia de glifs s'utilitza per a pintar el joc.
|
||||
-- Skin: nom del fitxer (sense extensio) dins de la carpeta skins/ que
|
||||
-- aporta els bitmaps i colors del joc. Skins inclosos:
|
||||
--
|
||||
-- "custom" — Redefinim els caracters CP437 (estil del Pascal original):
|
||||
-- bloc solid █, escala ═ doble, corda ─, cara ☻ del Pepe...
|
||||
-- Es el look "fidel a l'original de 2000".
|
||||
-- "custom" — Estil fidel a l'original de Pascal (CP437: █ ═ ─ ☻ X).
|
||||
-- "native" — Bitmaps copiats del ROM nadiu d'ascii (look "fantasy console").
|
||||
-- "pintor" — Look revisat amb sprites propis (Pepe i 3 enemics diferents,
|
||||
-- escala de ma, pedra que decreix d'altura al cavar...).
|
||||
--
|
||||
-- "native" — Usem els glifs ja dibuixats al ROM d'ascii, sense redefinir
|
||||
-- cap. Per a vore quin glif te cada codi, mira la
|
||||
-- chuleta_font_ascii.png. Estil mes fantasy console.
|
||||
--
|
||||
-- (En els dos casos el char 0 es reescriu a zeros, perque el ROM d'ascii
|
||||
-- Cada skin defineix la seva propia paleta i bitmaps. Per a personalitzar
|
||||
-- colors o sprites, edita el fitxer corresponent a skins/<nom>.lua.
|
||||
-- (En tots els casos el char 0 es reescriu a zeros, perque el ROM d'ascii
|
||||
-- hi te una caixa hueca que taparia tot el mapa.)
|
||||
skin = "native"
|
||||
|
||||
-- ====================================================================
|
||||
-- PALETA DE COLORS
|
||||
-- ====================================================================
|
||||
-- Constants disponibles:
|
||||
-- COLOR_BLACK=0 COLOR_BLUE=1 COLOR_GREEN=2 COLOR_CYAN=3
|
||||
-- COLOR_RED=4 COLOR_MAGENTA=5 COLOR_BROWN=6 COLOR_LIGHT_GRAY=7
|
||||
-- COLOR_DARK_GRAY=8 COLOR_LIGHT_BLUE=9 COLOR_LIGHT_GREEN=10
|
||||
-- COLOR_LIGHT_CYAN=11 COLOR_LIGHT_RED=12 COLOR_LIGHT_MAGENTA=13
|
||||
-- COLOR_YELLOW=14 COLOR_WHITE=15
|
||||
--
|
||||
-- Pots sobreescriure nomes les que vulgues. Comenta una linia
|
||||
-- per a deixar el valor per defecte.
|
||||
|
||||
-- colors.bg = COLOR_BLUE -- fons del nivell
|
||||
-- colors.pedra = COLOR_BROWN -- murs i blocs degradats
|
||||
-- colors.diners = COLOR_YELLOW -- $ monedes
|
||||
-- colors.escala = COLOR_LIGHT_CYAN -- ═ escales
|
||||
-- colors.corda = COLOR_LIGHT_GRAY -- ─ cordes
|
||||
-- colors.pepe = COLOR_WHITE -- el protagonista
|
||||
-- colors.pepe_invuln = COLOR_LIGHT_GREEN -- parpadeig en invulnerabilitat
|
||||
-- colors.malo = COLOR_LIGHT_RED -- enemics
|
||||
-- colors.malo_carrega = COLOR_LIGHT_MAGENTA -- enemic portant diners
|
||||
-- colors.malo_atrapat = COLOR_BROWN -- enemic atrapat en un forat
|
||||
-- colors.hud_text = COLOR_WHITE -- text del rotul inferior
|
||||
-- colors.hud_bg = COLOR_BLACK -- fons del rotul inferior
|
||||
-- colors.border = COLOR_BLUE -- vora exterior de la finestra
|
||||
-- colors.title = COLOR_LIGHT_RED -- GAME OVER / NOU RECORD
|
||||
skin = "pintor"
|
||||
|
||||
-- ====================================================================
|
||||
-- TECLES
|
||||
|
||||
+89
-67
@@ -21,6 +21,14 @@ BLOC3 = 178
|
||||
PEPE_C = 2
|
||||
MALO_C = 88
|
||||
|
||||
-- Code-points reservats addicionals (no venen del .map binari, son
|
||||
-- elements visuals introduits per la versio DX). Tots els skins els han
|
||||
-- de definir en estos mateixos cp per a ser intercanviables.
|
||||
PEPE_MORT_A = 226 -- sprite A de l'animacio de mort de Pepe
|
||||
PEPE_MORT_B = 227 -- sprite B (alterna amb A frame per frame)
|
||||
MALO_C2 = 89 -- enemic 2 (cada malos[i] usa el seu propi sprite)
|
||||
MALO_C3 = 90 -- enemic 3
|
||||
|
||||
-- Glifs del marc del HUD. Codis triats per a no col·lidir amb cap glif
|
||||
-- de cap skin (la native usa 224, 233, 216-220, etc.).
|
||||
FRAME_H = 240
|
||||
@@ -30,27 +38,19 @@ FRAME_TR = 243
|
||||
FRAME_BL = 244
|
||||
FRAME_BR = 245
|
||||
|
||||
-- Glif dedicat al fade (bloc 100% solid). Definit fora dels SKINS per a que
|
||||
-- funcione igual en custom i native, sense dependre del ROM nadiu.
|
||||
-- Glif dedicat al fade (bloc 100% solid). Definit en definir_marc() i no
|
||||
-- en cap skin: el fade ha de funcionar igual en totes les skins.
|
||||
FADE_BLOCK = 246
|
||||
|
||||
-- Skins: cada skin es una taula tile_id → codi_de_glif_a_pintar.
|
||||
-- "custom" usa els mateixos codis CP437 (redibuixats amb setchar).
|
||||
-- "native" remapeja als glifs que ja existeixen al ROM d'ascii
|
||||
-- (mira chuleta_font_ascii.png per a identificar-los).
|
||||
SKINS = {
|
||||
custom = {
|
||||
[BUIT]=0, [DINERS]=36, [PEDRA]=219, [ESCALA]=205, [CORDA]=196,
|
||||
[BLOC1]=176, [BLOC2]=177, [BLOC3]=178,
|
||||
[PEPE_C]=2, [MALO_C]=88,
|
||||
},
|
||||
native = {
|
||||
[BUIT]=0, [DINERS]=36, [PEDRA]=233, [ESCALA]=61, [CORDA]=45,
|
||||
[BLOC1]=216, [BLOC2]=218, [BLOC3]=220,
|
||||
[PEPE_C]=224,[MALO_C]=88,
|
||||
},
|
||||
}
|
||||
glif = SKINS.custom -- s'actualitza a init() segons la config
|
||||
-- La definicio de cada skin viu en `skins/<nom>.lua` (bitmaps, colors).
|
||||
-- En arrancar el joc, `carregar_skin()` carrega el fitxer corresponent al
|
||||
-- valor de `skin` i ompli les variables globals seguents:
|
||||
-- skin_data → tabla amb { elements = {...}, state_colors = {...} }
|
||||
-- glif → mapa tipo_logic_numeric → cp_a_pintar (BUIT→0, PEDRA→219, ...)
|
||||
-- colors → mapa nom_logic → COLOR_X (colors.pedra, colors.bg, ...)
|
||||
skin_data = nil
|
||||
glif = {}
|
||||
colors = {}
|
||||
|
||||
-- Tecles del joc — sobreescriuibles per config.lua.
|
||||
-- Nota: KEY_ESCAPE no es pot usar perque el interpret ascii la captura
|
||||
@@ -65,27 +65,6 @@ keys = {
|
||||
quit = KEY_Q, -- abandona la partida → game over
|
||||
}
|
||||
|
||||
-- Paleta — tots els colors son sobreescriuibles per config.lua.
|
||||
-- bg es el color del fons del nivell (pintat tant a les cel·les buides com
|
||||
-- darrere de cada glif), per a que tot quede integrat en lloc de tindre
|
||||
-- negre darrere dels caracters.
|
||||
colors = {
|
||||
bg = COLOR_BLUE, -- fons del nivell
|
||||
pedra = COLOR_BROWN,
|
||||
diners = COLOR_YELLOW,
|
||||
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
|
||||
malo_atrapat = COLOR_BROWN, -- enemic atrapat en un forat (color de pedra)
|
||||
hud_text = COLOR_WHITE,
|
||||
hud_bg = COLOR_BLACK,
|
||||
border = COLOR_BLUE,
|
||||
title = COLOR_LIGHT_RED,
|
||||
}
|
||||
|
||||
-- Textos del joc — sobreescriuibles per config.lua (taula `textos`).
|
||||
-- Tots en sentence case (Inicial Majuscula, resta minuscula).
|
||||
textos = {
|
||||
@@ -139,7 +118,7 @@ ESTAT_ENTERNAME = "entername"
|
||||
-- Estat global
|
||||
mapa = {} -- mapa[x][y] = { tipo=, color=, temps= }
|
||||
level = 1
|
||||
pepe = { x=19, y=23, dibuix=PEPE_C, color=colors.pepe, vides=VIDES_INI, estat=NORMAL,
|
||||
pepe = { x=19, y=23, dibuix=PEPE_C, vides=VIDES_INI, estat=NORMAL,
|
||||
mort_t=0, invuln_t=0 }
|
||||
malos = {}
|
||||
score = 0
|
||||
@@ -182,23 +161,55 @@ BAYER4 = {
|
||||
{ 15, 7, 13, 5 },
|
||||
}
|
||||
|
||||
-- Mapeja id_logic_string (com surten en skins/*.lua) → constant numerica
|
||||
-- interna del .lua (BUIT, PEDRA, ...). S'usa per a omplir glif[] des de
|
||||
-- l'estructura declarativa del fitxer de skin.
|
||||
local ELEMENT_TO_TIPO = {
|
||||
diners = DINERS, pedra = PEDRA, escala = ESCALA, corda = CORDA,
|
||||
bloc1 = BLOC1, bloc2 = BLOC2, bloc3 = BLOC3,
|
||||
pepe = PEPE_C,
|
||||
pepe_mort_a = PEPE_MORT_A, pepe_mort_b = PEPE_MORT_B,
|
||||
malo1 = MALO_C, malo2 = MALO_C2, malo3 = MALO_C3,
|
||||
}
|
||||
|
||||
-- Carrega skins/<skin>.lua i ompli glif[] + colors{} a partir de la taula
|
||||
-- declarativa. Si el fitxer no existeix o falla, fallback silenciós a custom.
|
||||
function carregar_skin()
|
||||
local ok, data = pcall(dofile, "skins/"..skin..".lua")
|
||||
if not ok or type(data) ~= "table" then
|
||||
data = dofile("skins/custom.lua")
|
||||
end
|
||||
skin_data = data
|
||||
|
||||
glif = {}
|
||||
glif[BUIT] = 0
|
||||
for name, elem in pairs(skin_data.elements) do
|
||||
local tipo = ELEMENT_TO_TIPO[name]
|
||||
if tipo then glif[tipo] = elem.cp end
|
||||
end
|
||||
|
||||
colors = {}
|
||||
for name, elem in pairs(skin_data.elements) do
|
||||
colors[name] = elem.color
|
||||
end
|
||||
-- Alias per a codi historic que encara mira `colors.malo` (ex: pintar_pepe
|
||||
-- al tram curt de l'animacio de mort).
|
||||
colors.malo = skin_data.elements.malo1.color
|
||||
for k, v in pairs(skin_data.state_colors) do colors[k] = v end
|
||||
end
|
||||
|
||||
function definir_glifs()
|
||||
-- Char 0 sempre buit (el ROM d'ascii hi te una caixa que taparia el mapa)
|
||||
setchar(0, 0,0,0,0,0,0,0,0)
|
||||
|
||||
-- Nomes la skin "custom" redibuixa els glifs CP437. La "native" usa
|
||||
-- els que ja existeixen al ROM d'ascii (cap setchar mes).
|
||||
if skin ~= "custom" then return end
|
||||
|
||||
setchar(219, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF) -- PEDRA █
|
||||
setchar(36, 0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00) -- DINERS $
|
||||
setchar(205, 0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00) -- ESCALA ═
|
||||
setchar(196, 0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00) -- CORDA ─
|
||||
setchar(176, 0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11) -- BLOC1 ░
|
||||
setchar(177, 0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55) -- BLOC2 ▒
|
||||
setchar(178, 0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,0xBB,0xEE) -- BLOC3 ▓
|
||||
setchar(2, 0x7E,0x81,0xA5,0x81,0xBD,0x99,0x81,0x7E) -- PEPE ☻
|
||||
setchar(88, 0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3) -- MALO X
|
||||
-- Aplica els bitmaps de la skin activa. Si un element te bitmap=nil,
|
||||
-- es deixa el cp tal com estiga al ROM nadiu (cas no usat ara mateix).
|
||||
for _, elem in pairs(skin_data.elements) do
|
||||
local b = elem.bitmap
|
||||
if b then
|
||||
setchar(elem.cp, b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Glifs del marc del HUD (sempre, independent de la skin del joc)
|
||||
@@ -362,7 +373,7 @@ function pintar_mapa(offset_x)
|
||||
end
|
||||
|
||||
function pintar_pepe()
|
||||
local col = pepe.color
|
||||
local col = colors.pepe
|
||||
local g = glif[pepe.dibuix]
|
||||
|
||||
if pepe.mort_t > 0 then
|
||||
@@ -371,16 +382,21 @@ function pintar_pepe()
|
||||
|
||||
-- Animacio visual de mort, en dos trams desproporcionats (1/4 + 3/4):
|
||||
-- tram curt: parpadeja blanc/roig amb la cara normal del Pepe.
|
||||
-- tram llarg: glif passa a la careta trista (codi 225 del ROM
|
||||
-- d'ascii, no redefinit per cap skin) parpadejant roig/bg.
|
||||
-- tram llarg: alterna entre els dos sprites de mort de la skin
|
||||
-- (pepe_mort_a / pepe_mort_b), cada un amb el seu color propi.
|
||||
local fase = (temps.mort_anim_frames + temps.respawn_delay_frames)
|
||||
- pepe.mort_t -- 0..mort_anim_frames-1
|
||||
local tram_curt = flr(temps.mort_anim_frames / 4)
|
||||
if fase < tram_curt then
|
||||
col = (fase % 6 < 3) and colors.malo or colors.pepe
|
||||
else
|
||||
g = 225
|
||||
col = ((fase - tram_curt) % 12 < 6) and colors.malo or colors.bg
|
||||
if ((fase - tram_curt) % 12) < 6 then
|
||||
g = glif[PEPE_MORT_A]
|
||||
col = colors.pepe_mort_a
|
||||
else
|
||||
g = glif[PEPE_MORT_B]
|
||||
col = colors.pepe_mort_b
|
||||
end
|
||||
end
|
||||
elseif pepe.invuln_t > 0 then
|
||||
-- Invulnerabilitat: parpadeja entre colors.pepe i colors.pepe_invuln
|
||||
@@ -747,19 +763,25 @@ end
|
||||
-- ====================================================================
|
||||
|
||||
function init_malos()
|
||||
local function novo(x, y)
|
||||
return { x=x, y=y, color=colors.malo, estat=ESQUERRA, iaclock=0,
|
||||
-- Cada malo te el seu propi sprite (1, 2 o 3) i guardem el seu color
|
||||
-- base per a poder restaurar-lo despres de respawn o de soltar carrega.
|
||||
local function novo(x, y, sprite)
|
||||
local cname = "malo"..sprite -- "malo1" | "malo2" | "malo3"
|
||||
return { x=x, y=y, sprite=sprite,
|
||||
color=colors[cname], color_base=colors[cname],
|
||||
estat=ESQUERRA, iaclock=0,
|
||||
carrega={ok=false, x=0, y=0}, atrapat=false,
|
||||
dropped_x=nil, dropped_y=nil }
|
||||
end
|
||||
malos = { novo(9, 2), novo(20, 2), novo(39, 2) }
|
||||
malos = { novo(9, 2, 1), novo(20, 2, 2), novo(39, 2, 3) }
|
||||
end
|
||||
|
||||
function pintar_malos()
|
||||
local cps = { glif[MALO_C], glif[MALO_C2], glif[MALO_C3] }
|
||||
for i = 1, NUM_MALOS do
|
||||
local m = malos[i]
|
||||
color(m.color, colors.bg)
|
||||
print(chr(glif[MALO_C]), m.x, m.y)
|
||||
print(chr(cps[m.sprite]), m.x, m.y)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -834,7 +856,7 @@ function mort_malo(m)
|
||||
end
|
||||
end
|
||||
m.x = 39; m.y = 1
|
||||
m.color = colors.malo
|
||||
m.color = m.color_base
|
||||
m.estat = CAENT
|
||||
m.iaclock = 0
|
||||
m.atrapat = false
|
||||
@@ -1053,7 +1075,7 @@ function pintar_hud()
|
||||
local score_label = textos.score_label.." "
|
||||
print(score_label, 16, 26)
|
||||
if score_display < score then
|
||||
color(colors.diners, colors.hud_bg)
|
||||
color(colors.score_flash, colors.hud_bg)
|
||||
end
|
||||
print(string.format("%03d", score_display), 16 + strlen(score_label), 26)
|
||||
color(colors.hud_text, colors.hud_bg)
|
||||
@@ -1073,7 +1095,7 @@ function carregar_config()
|
||||
-- Accedim per nom (_G) per a que aço seguisca funcionant fins i tot si
|
||||
-- l'usuari reasigna tota la taula en config.lua (ex: `colors = {bg=...}`
|
||||
-- en lloc de mutar camps individuals).
|
||||
local noms = { "colors", "keys", "textos", "temps" }
|
||||
local noms = { "keys", "textos", "temps" }
|
||||
local saved = {}
|
||||
for _, nom in ipairs(noms) do
|
||||
saved[nom] = {}
|
||||
@@ -1089,7 +1111,7 @@ end
|
||||
|
||||
function init()
|
||||
carregar_config()
|
||||
glif = SKINS[skin] or SKINS.custom
|
||||
carregar_skin()
|
||||
mode(1)
|
||||
border(colors.border)
|
||||
color(colors.bg, colors.bg) -- ink no importa, paper=bg perque el cls() final empleni amb bg
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
-- Skin "custom" — el look fidel a l'original de Pascal (CP437).
|
||||
-- Per als sprites nous (pepe_mort_a/b, malo2/3) repetim els bitmaps base
|
||||
-- perque la skin original no tenia sprites diferents per a cada cas.
|
||||
--
|
||||
-- Constants de color disponibles (paleta CGA/EGA de 16, vore ASCII_API.md §3):
|
||||
-- COLOR_BLACK=0 COLOR_DARK_GRAY=8
|
||||
-- COLOR_BLUE=1 COLOR_LIGHT_BLUE=9
|
||||
-- COLOR_GREEN=2 COLOR_LIGHT_GREEN=10
|
||||
-- COLOR_CYAN=3 COLOR_LIGHT_CYAN=11
|
||||
-- COLOR_RED=4 COLOR_LIGHT_RED=12
|
||||
-- COLOR_MAGENTA=5 COLOR_LIGHT_MAGENTA=13
|
||||
-- COLOR_BROWN=6 COLOR_YELLOW=14
|
||||
-- COLOR_LIGHT_GRAY=7 COLOR_WHITE=15
|
||||
return {
|
||||
elements = {
|
||||
diners = { cp = 36, bitmap = {0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00}, color = COLOR_YELLOW },
|
||||
pedra = { cp = 219, bitmap = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}, color = COLOR_BROWN },
|
||||
escala = { cp = 205, bitmap = {0x00,0x00,0xFF,0x00,0x00,0xFF,0x00,0x00}, color = COLOR_LIGHT_CYAN },
|
||||
corda = { cp = 196, bitmap = {0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00}, color = COLOR_LIGHT_GRAY },
|
||||
bloc1 = { cp = 176, bitmap = {0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11}, color = COLOR_BROWN },
|
||||
bloc2 = { cp = 177, bitmap = {0xAA,0x55,0xAA,0x55,0xAA,0x55,0xAA,0x55}, color = COLOR_BROWN },
|
||||
bloc3 = { cp = 178, bitmap = {0xBB,0xEE,0xBB,0xEE,0xBB,0xEE,0xBB,0xEE}, color = COLOR_BROWN },
|
||||
pepe = { cp = 2, bitmap = {0x7E,0x81,0xA5,0x81,0xBD,0x99,0x81,0x7E}, color = COLOR_WHITE },
|
||||
pepe_mort_a = { cp = 226, bitmap = {0x7E,0x81,0xA5,0x81,0x99,0xBD,0x81,0x7E}, color = COLOR_LIGHT_RED },
|
||||
pepe_mort_b = { cp = 227, bitmap = {0x7E,0x81,0xA5,0x81,0x99,0xBD,0x81,0x7E}, color = COLOR_LIGHT_RED },
|
||||
malo1 = { cp = 88, bitmap = {0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3}, color = COLOR_LIGHT_RED },
|
||||
malo2 = { cp = 89, bitmap = {0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3}, color = COLOR_LIGHT_RED },
|
||||
malo3 = { cp = 90, bitmap = {0x00,0xC3,0x66,0x3C,0x18,0x3C,0x66,0xC3}, color = COLOR_LIGHT_RED },
|
||||
},
|
||||
state_colors = {
|
||||
bg = COLOR_BLUE,
|
||||
border = COLOR_BLUE,
|
||||
hud_text = COLOR_WHITE,
|
||||
hud_bg = COLOR_BLACK,
|
||||
title = COLOR_LIGHT_RED,
|
||||
pepe_invuln = COLOR_LIGHT_GREEN,
|
||||
malo_carrega = COLOR_LIGHT_MAGENTA,
|
||||
malo_atrapat = COLOR_BROWN,
|
||||
score_flash = COLOR_YELLOW,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
-- Skin "native" — bitmaps copiats del ROM nadiu d'ascii (rom.h) als
|
||||
-- code-points reservats per a cada element. Manté la regla "cp idèntics
|
||||
-- en totes les skins" sense haver de dependre que el ROM tinga el glif
|
||||
-- en eixos code-points concrets.
|
||||
--
|
||||
-- Constants de color disponibles (paleta CGA/EGA de 16, vore ASCII_API.md §3):
|
||||
-- COLOR_BLACK=0 COLOR_DARK_GRAY=8
|
||||
-- COLOR_BLUE=1 COLOR_LIGHT_BLUE=9
|
||||
-- COLOR_GREEN=2 COLOR_LIGHT_GREEN=10
|
||||
-- COLOR_CYAN=3 COLOR_LIGHT_CYAN=11
|
||||
-- COLOR_RED=4 COLOR_LIGHT_RED=12
|
||||
-- COLOR_MAGENTA=5 COLOR_LIGHT_MAGENTA=13
|
||||
-- COLOR_BROWN=6 COLOR_YELLOW=14
|
||||
-- COLOR_LIGHT_GRAY=7 COLOR_WHITE=15
|
||||
return {
|
||||
elements = {
|
||||
diners = { cp = 36, bitmap = {0x18,0x3E,0x58,0x3C,0x1A,0x7C,0x18,0x00}, color = COLOR_YELLOW },
|
||||
pedra = { cp = 219, bitmap = {0x00,0x7E,0x7E,0x7E,0x7E,0x7E,0x7E,0x00}, color = COLOR_BROWN },
|
||||
escala = { cp = 205, bitmap = {0x00,0x00,0x7E,0x00,0x00,0x7E,0x00,0x00}, color = COLOR_LIGHT_CYAN },
|
||||
corda = { cp = 196, bitmap = {0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00}, color = COLOR_LIGHT_GRAY },
|
||||
bloc1 = { cp = 176, bitmap = {0xAA,0x55,0xAA,0x55,0x00,0x00,0x00,0x00}, color = COLOR_BROWN },
|
||||
bloc2 = { cp = 177, bitmap = {0x00,0x00,0x00,0x00,0xAA,0x55,0xAA,0x55}, color = COLOR_BROWN },
|
||||
bloc3 = { cp = 178, bitmap = {0xAA,0x54,0xA8,0x50,0xA0,0x40,0x80,0x00}, color = COLOR_BROWN },
|
||||
pepe = { cp = 2, bitmap = {0x7E,0xFF,0x99,0xFF,0xBD,0xC3,0xFF,0x7E}, color = COLOR_WHITE },
|
||||
pepe_mort_a = { cp = 226, bitmap = {0x7E,0xFF,0x99,0xFF,0xC3,0xBD,0xFF,0x7E}, color = COLOR_LIGHT_RED },
|
||||
pepe_mort_b = { cp = 227, bitmap = {0x7E,0xFF,0x99,0xFF,0xC3,0xBD,0xFF,0x7E}, color = COLOR_LIGHT_RED },
|
||||
malo1 = { cp = 88, bitmap = {0xC6,0x6C,0x38,0x38,0x6C,0xC6,0xC6,0x00}, color = COLOR_LIGHT_RED },
|
||||
malo2 = { cp = 89, bitmap = {0xC6,0x6C,0x38,0x38,0x6C,0xC6,0xC6,0x00}, color = COLOR_LIGHT_RED },
|
||||
malo3 = { cp = 90, bitmap = {0xC6,0x6C,0x38,0x38,0x6C,0xC6,0xC6,0x00}, color = COLOR_LIGHT_RED },
|
||||
},
|
||||
state_colors = {
|
||||
bg = COLOR_BLUE,
|
||||
border = COLOR_BLUE,
|
||||
hud_text = COLOR_WHITE,
|
||||
hud_bg = COLOR_BLACK,
|
||||
title = COLOR_LIGHT_RED,
|
||||
pepe_invuln = COLOR_LIGHT_GREEN,
|
||||
malo_carrega = COLOR_LIGHT_MAGENTA,
|
||||
malo_atrapat = COLOR_BROWN,
|
||||
score_flash = COLOR_YELLOW,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
-- Skin "pintor" — bitmaps i colors creats per a la versio DX.
|
||||
-- Format del fitxer:
|
||||
-- elements = id_logic_string → { cp = code_point, bitmap = {8 bytes}|nil, color = COLOR_X }
|
||||
-- state_colors = nom_estat → COLOR_X (ambient i estats del joc, no lligats a un element)
|
||||
--
|
||||
-- Constants de color disponibles (paleta CGA/EGA de 16, vore ASCII_API.md §3):
|
||||
-- COLOR_BLACK=0 COLOR_DARK_GRAY=8
|
||||
-- COLOR_BLUE=1 COLOR_LIGHT_BLUE=9
|
||||
-- COLOR_GREEN=2 COLOR_LIGHT_GREEN=10
|
||||
-- COLOR_CYAN=3 COLOR_LIGHT_CYAN=11
|
||||
-- COLOR_RED=4 COLOR_LIGHT_RED=12
|
||||
-- COLOR_MAGENTA=5 COLOR_LIGHT_MAGENTA=13
|
||||
-- COLOR_BROWN=6 COLOR_YELLOW=14
|
||||
-- COLOR_LIGHT_GRAY=7 COLOR_WHITE=15
|
||||
return {
|
||||
elements = {
|
||||
diners = { cp = 36, bitmap = {0x18,0x3E,0x60,0x3C,0x06,0x7C,0x18,0x00}, color = COLOR_YELLOW },
|
||||
pedra = { cp = 219, bitmap = {0xFF,0xF6,0xBF,0xFE,0xF7,0xBE,0xFF,0xAA}, color = COLOR_BROWN },
|
||||
escala = { cp = 205, bitmap = {0xC3,0xFF,0xFF,0xC3,0xC3,0xFF,0xFF,0xC3}, color = COLOR_LIGHT_GRAY },
|
||||
corda = { cp = 196, bitmap = {0x00,0x00,0x00,0xFF,0xFF,0x00,0x00,0x00}, color = COLOR_LIGHT_GRAY },
|
||||
-- Bloc 1/2/3: la pedra es cava decrescut en altura, pero mantenint
|
||||
-- la textura de la pedra (les files inferiors de pedra) per a que es
|
||||
-- veja com si la pedra real es va desfent des de dalt.
|
||||
bloc1 = { cp = 176, bitmap = {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xAA}, color = COLOR_BROWN },
|
||||
bloc2 = { cp = 177, bitmap = {0x00,0x00,0x00,0x00,0xF7,0xBE,0xFF,0xAA}, color = COLOR_BROWN },
|
||||
bloc3 = { cp = 178, bitmap = {0x00,0x00,0xBF,0xFE,0xF7,0xBE,0xFF,0xAA}, color = COLOR_BROWN },
|
||||
pepe = { cp = 2, bitmap = {0x7E,0xFF,0xDB,0xDB,0xFF,0xC3,0xE7,0x7E}, color = COLOR_YELLOW },
|
||||
pepe_mort_a = { cp = 226, bitmap = {0x7E,0xFF,0x93,0xFF,0xFF,0xAB,0xD7,0x7E}, color = COLOR_LIGHT_RED },
|
||||
pepe_mort_b = { cp = 227, bitmap = {0x7E,0xFF,0xC9,0xFF,0xFF,0xD5,0xEB,0x7E}, color = COLOR_LIGHT_MAGENTA },
|
||||
malo1 = { cp = 88, bitmap = {0xC3,0x3C,0x7E,0x72,0x7E,0x72,0x3C,0xC3}, color = COLOR_LIGHT_RED },
|
||||
malo2 = { cp = 89, bitmap = {0xD8,0x33,0x7C,0xFC,0xFC,0x7C,0x33,0xD8}, color = COLOR_LIGHT_RED },
|
||||
malo3 = { cp = 90, bitmap = {0x07,0xEB,0x38,0x38,0x38,0x38,0xEB,0x07}, color = COLOR_LIGHT_RED },
|
||||
},
|
||||
state_colors = {
|
||||
bg = COLOR_BLUE,
|
||||
border = COLOR_BLUE,
|
||||
hud_text = COLOR_WHITE,
|
||||
hud_bg = COLOR_LIGHT_BLUE,
|
||||
title = COLOR_LIGHT_RED,
|
||||
pepe_invuln = COLOR_LIGHT_GREEN,
|
||||
malo_carrega = COLOR_LIGHT_MAGENTA,
|
||||
malo_atrapat = COLOR_BROWN,
|
||||
score_flash = COLOR_YELLOW,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user