- [ONGOING] Treballant en la clase "level"

This commit is contained in:
2025-06-19 13:58:44 +02:00
parent 79ab41e98d
commit 9f884751cc
4 changed files with 127 additions and 29 deletions

View File

@@ -14,17 +14,20 @@ end
function mini.update()
view.origin(0,0)
surf.cls(1)
level.draw_background()
surf.source(sprites)
draw.surf(0, 0, 16, 17, 10, 10, 16, 17)
surf.source(tiles)
level.draw_foreground()
surf.source(sprites)
draw.surf(0, 0, 16, 17, 10, 10, 16, 17)
surf.source(tiles)
surf.target(0)
--draw.surf(0, 0, 64, 64, 10, 10)
-- Pintar el marcador
-- [TODO]
-- Pintar el mapa i sprites
level.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
sys.quit()
end