- [CHG] Mòdul "level" renomenat a "rooms"

- [NEW] Mòdul "menu"
- [NEW] Mòdul "popup"
This commit is contained in:
2025-06-19 22:11:05 +02:00
parent 9f884751cc
commit bbbf9d0c50
8 changed files with 191 additions and 101 deletions

View File

@@ -1,5 +1,5 @@
require "level"
require "rooms"
require "menu"
x=0
function mini.init()
@@ -8,7 +8,8 @@ function mini.init()
surf.source(tiles)
pal.set(pal.load("tiles.gif"))
pal.trans(0)
level.init()
rooms.init()
menu.show()
end
function mini.update()
@@ -16,19 +17,23 @@ function mini.update()
surf.cls(1)
surf.target(0)
menu.draw()
-- Pintar el marcador
-- [TODO]
-- Pintar el mapa i sprites
level.draw()
rooms.draw()
view.origin(0,0)
local mx, my = mouse.pos()
mx, my = math.floor(mx/8)*8, math.floor(my/8)*8
draw.rect(mx-1, my-1, 10, 10, 28)
draw.rect(mx, my, 8, 8, 1)
if (key.down(key.ESCAPE)) then
if my>=8 then
draw.rect(mx-1, my-1, 10, 10, 28)
draw.rect(mx, my, 8, 8, 1)
end
if key.press(key.ESCAPE) then
sys.quit()
end
end