- [FIX] No permetia carregar GIFs de mes de 256 pixels de ample o alt

- [FIX] No tornava be la ruta al arxiu de configuració
- [NEW] Ara guarda en "~/.config/jailgames/loquesiga/"
- [FIX] El mapa de tiles ha de pillar els tiles de la surface source
- [NEW] Actualitzada la llibreria de autocompletar per a vscode
This commit is contained in:
2025-05-31 14:28:20 +02:00
parent 8f98d52385
commit 8e855fa2c1
5 changed files with 219 additions and 298 deletions

View File

@@ -3,104 +3,14 @@ other = require "other"
x=0
function mini.init()
text=other.peiv()
keyRight = tonumber(config.getKey("keyright")) or key.RIGHT
keyLeft = tonumber(config.getKey("keyleft")) or key.LEFT
mini.update=normal_update
--turbo(false)
local perico = "péricòñ"
print(utf8.len(perico))
ants = 0xc936;
s = surface.load("tiles01.gif")
--surface.source(s)
p = palette.load("tiles01.gif")
palette.set(p)
palette.setTransparent(255)
print(#p)
surface.save(s, "data/copy.gif")
s = surface.load("copy.gif")
--draw.source(s)
system.setBeat(4)
s = surf.load("sprites.gif")
surf.source(s)
p = pal.load("sprites.gif")
pal.set(p)
pal.trans(255)
end
function mini.update()
if keyboard.keyPressed(key.ESCAPE) then
system.quit()
end
if system.isBeat() then
ants = (ants >> 12) | ((ants<<4)&0xffff)
end
surface.cls(5)
draw.surface(s, 0, 0, 64, 64, 10, 10)
draw.rect(10, 10, 73, 73, 8)
draw.setPattern(ants)
draw.rect(10, 10, 73, 73, 0)
draw.setPattern(0xffff)
--draw.text(#p,0,0,2)
surf.cls(1)
draw.surf(0, 0, 64, 64, 10, 10)
end
function normal_update()
if keyboard.keyPressed(key.RIGHT) then x=x+1 end
if keyboard.keyPressed(key.LEFT) then x=x-1 end
if keyboard.keyPressed(key.SPACE) then
redefinekeys.init()
end
if keyboard.keyPressed(key.ESCAPE) then
system.quit()
end
if keyboard.keyPressed(key.F2) or mouse.buttonPressed(1) then
local val = window.getZoom() + 2
if val >= 10 then val = 2 end
window.setZoom(val)
elseif keyboard.keyPressed(key.F3) then
window.setFullscreen(not window.getFullscreen())
end
if x>160 then x=-utf8.len(text)*4 end
viewport.resetClipping()
viewport.setOrigin(0,0)
surface.cls(20)
viewport.setClipping(10,10,140,100)
surface.cls(3)
draw.text("HOLA",0,0,5)
viewport.setOrigin(-70,-50)
draw.text("ORÍGIN",0,0,5)
draw.text(text,x,10,5)
draw.circFill(20,20,10,15);
draw.setPattern(0x5a5a);
draw.circFill(20,20,10,10);
draw.setPattern(0xffff);
end
redefinekeys = {
state = 0,
init = function ()
redefinekeys.state=0
_update=redefinekeys.update
end,
update = function()
surface.cls(20)
if redefinekeys.state == 0 then
draw.text("PULSA TECLA PER A DRETA...",0,0,10)
local key = keyboard.keyPressed();
if key ~= 0 then
redefinekeys.state = 1
keyRight=key
config.setKey("keyright", keyRight)
end
elseif redefinekeys.state == 1 then
draw.text("PULSA TECLA PER A ESQUERRA...",0,0,10)
local key = keyboard.keyPressed();
if key ~= 0 then
keyLeft=key
config.setKey("keyleft", keyLeft)
_update=normal_update
end
end
end
}