- [NEW] Minimapa en el editor

- [NEW] Diferent marcador
- [NEW] Més habitacions
This commit is contained in:
Raimon @ quifisraimon committed 2026-10-01 12:44:07 +02:00
1 parent a86011ba37
commit 8a770de885
12 files changed
+359 -24

No files matched your search

+10 -10
View File
@@ -1,11 +1,11 @@
bitmap=gfx/score_font.gif
48: 0 0 8 8 0 # 0
49: 8 0 8 8 0 # 1
50: 16 0 8 8 0 # 2
51: 24 0 8 8 0 # 3
52: 32 0 8 8 0 # 4
53: 40 0 8 8 0 # 5
54: 48 0 8 8 0 # 6
55: 56 0 8 8 0 # 7
56: 64 0 8 8 0 # 8
57: 72 0 8 8 0 # 9
48: 0 0 7 8 0 # 0
49: 7 0 7 8 0 # 1
50: 14 0 7 8 0 # 2
51: 21 0 7 8 0 # 3
52: 28 0 7 8 0 # 4
53: 35 0 7 8 0 # 5
54: 42 0 7 8 0 # 6
55: 49 0 7 8 0 # 7
56: 56 0 7 8 0 # 8
57: 63 0 7 8 0 # 9
Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

+12 -12
View File
@@ -1,6 +1,6 @@
score = {
points = 0,
color = 21,
color = 28,
ypos = 3,
surf = nil,
font = nil
@@ -17,16 +17,16 @@ local function draw_text()
font.current(me.font)
font.spacing(0)
local txt = string.format("%03d", me.points)
draw.text(txt,2,me.ypos-1,27)
draw.text(txt,3,me.ypos-1,27)
draw.text(txt,4,me.ypos-1,27)
draw.text(txt,2,me.ypos,27)
draw.text(txt,4,me.ypos,27)
draw.text(txt,2,me.ypos+1,27)
draw.text(txt,4,me.ypos+1,27)
draw.text(txt,2,me.ypos+2,27)
draw.text(txt,3,me.ypos+2,27)
draw.text(txt,4,me.ypos+2,27)
-- draw.text(txt,2,me.ypos-1,27)
-- draw.text(txt,3,me.ypos-1,27)
-- draw.text(txt,4,me.ypos-1,27)
-- draw.text(txt,2,me.ypos,27)
-- draw.text(txt,4,me.ypos,27)
-- draw.text(txt,2,me.ypos+1,27)
-- draw.text(txt,4,me.ypos+1,27)
-- draw.text(txt,2,me.ypos+2,27)
-- draw.text(txt,3,me.ypos+2,27)
-- draw.text(txt,4,me.ypos+2,27)
draw.text(txt,3,me.ypos+1,1)
draw.text(txt,3,me.ypos,me.color)
font.current(font.DEFAULT)
@@ -64,6 +64,6 @@ end
function me.inc(value)
me.points = me.points + value
tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) me.color = (math.floor(val)&1) == 0 and 21 or 14 end)
tweening.add(8, 0, 0.5, easing.linear, function(val,progress,finished) me.color = (math.floor(val)&1) == 0 and 28 or 14 end)
tweening.add(5, 3, 0.5, easing.easeOutElastic, function(val,progress,finished) me.ypos = math.floor(val) end)
end
+52
View File
@@ -1,6 +1,7 @@
require ":modules.menu"
require ":utils.msgbox"
require ":modules.items"
require ":utils.palfade"
editor = {
@@ -148,6 +149,8 @@ editor = {
else
editor.itempicker.show()
end
elseif key.press(key.GRAVE) then
editor.mapviewer.show()
elseif key.press(key.P) then
sprites.hero.pos.x = tx*8-4
sprites.hero.pos.y = ty*8-9
@@ -343,6 +346,55 @@ editor = {
end
},
mapviewer = {
surf = nil,
pal = nil,
show = function()
if editor.mapviewer.surf == nil then editor.mapviewer.surf = surf.new(160,104) end
local background = surf.load("maps/rooms_background.gif")
local foreground = surf.load("maps/rooms_foreground.gif")
surf.target(surf.SCREEN)
surf.cls(0)
surf.target(editor.mapviewer.surf)
surf.source(background)
view.origin(0,0)
surf.clip()
draw.surf(0,0,160,104,0,0)
surf.source(foreground)
draw.surf(0,0,160,104,0,0)
if editor.mapviewer.pal == nil then editor.mapviewer.pal = pal.load("maps/tiles_palette.gif") end
pal.set(editor.mapviewer.pal)
app.push(editor.mapviewer.update)
end,
close = function()
surf.target(surf.SCREEN)
surf.cls(0)
pal.set(palfade.original)
app.pop()
end,
update = function()
surf.source(editor.mapviewer.surf)
surf.target(surf.SCREEN)
draw.surf(0,0,160,104,0,0)
local x = (rooms.pos.x//20)*20
local y = (rooms.pos.y//13)*13
draw.rect(x, y, 20, 13, 68)
if not key.down(key.GRAVE) then
editor.mapviewer.close()
end
end
},
itempicker = {
surf_back = nil,
pos_y = 24,
+2 -2
View File
@@ -74,7 +74,7 @@ game = {
score.draw()
view.origin(0,0)
draw.text("safe: "..sprites.last_safe_room,1,96,28)
--draw.text("safe: "..sprites.last_safe_room,1,96,28)
--draw.text(sprites.hero.pos.x ..","..sprites.hero.pos.y,14,89,28)
if key.press(key.ESCAPE) or key.press(key.F9) then
@@ -86,7 +86,7 @@ game = {
console.enable()
end
draw.text(sys.fps(),2,20,8)
--draw.text(sys.fps(),2,20,8)
end,
change_room = function(x,y)
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
from PIL import Image
import sys
if len(sys.argv) != 3:
print(f"Uso: {sys.argv[0]} entrada.png salida.pal")
sys.exit(1)
img = Image.open(sys.argv[1]).convert("RGB")
num_colors = img.width * img.height
with open(sys.argv[2], "w") as f:
f.write("JASC-PAL\n")
f.write("0100\n")
f.write(f"{num_colors}\n")
for y in range(img.height):
for x in range(img.width):
r, g, b = img.getpixel((x, y))
f.write(f"{r} {g} {b}\n")
print(f"Escritos {num_colors} colores en {sys.argv[2]}")
+259
View File
@@ -0,0 +1,259 @@
JASC-PAL
0100
256
0 0 0
206 195 177
121 128 126
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
60 42 22
118 80 46
125 87 47
115 77 45
130 91 49
122 83 46
190 187 178
238 232 214
190 187 178
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
121 84 45
125 87 47
85 49 37
79 43 36
9 5 4
86 60 32
28 23 48
28 23 48
0 0 0
28 23 48
17 14 29
28 23 48
25 21 43
22 22 14
13 13 8
0 0 0
130 91 49
120 82 46
130 91 49
97 60 40
0 0 0
0 0 0
28 23 48
0 0 0
0 0 0
28 23 48
5 4 9
28 23 48
15 15 10
1 1 1
17 17 11
15 15 10
240 189 119
197 145 84
240 189 119
128 94 54
255 0 0
0 0 0
28 23 48
20 16 35
28 23 48
28 23 48
0 0 0
0 0 0
24 24 16
3 3 2
1 1 1
0 0 0
240 189 119
186 137 79
77 57 34
173 127 74
146 109 66
0 0 0
0 0 0
19 5 7
20 16 35
3 3 6
116 173 187
116 173 187
5 5 3
0 0 0
26 26 17
0 0 0
240 189 119
197 145 84
207 156 92
222 171 105
227 176 109
99 73 42
37 27 15
138 101 59
162 142 125
128 111 97
153 134 117
126 109 96
153 134 117
153 134 117
170 149 132
0 0 0
24 7 9
17 5 6
229 178 110
190 140 81
197 145 84
67 49 28
36 26 15
2 0 0
20 6 7
0 0 0
124 107 94
140 122 107
141 123 108
153 134 117
55 47 42
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
22 19 39
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
26 8 10
1 0 0
10 3 4
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
21 6 8
26 8 10
33 10 13
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B