- [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

+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)