Files
JailGamer ef87fd3c25 [WIP] Reestructurant codi
[WIP] Stage 2 ja 'arranca'
2026-05-30 22:20:24 +02:00

56 lines
1.3 KiB
Lua

local mini_version = ""
local versio_req = {1,5,13}
local parts = {}
local printed = false
function reqs_init()
local version=sys.version()
-- print(version)
for part in string.gmatch(version, "[^.]+") do
table.insert(parts, tonumber(part))
end
-- print(parts[1].." "..versio_req[1])
-- print(parts[2].." "..versio_req[2])
-- print(parts[3].." "..versio_req[3])
states:next()
end
function reqs_draw()
-- print("LOGO DRAW "..logo_step)
surf.target(0)
surf.cls(16)
local str1 = "Es requerix mini "..table.concat(versio_req, ".")
local str2 = "Executant amb mini "..table.concat(parts, ".")
draw.text(str1,20,20,2)
draw.text(str2,20,30,2)
if not printed then
print(str1)
print(str2)
printed = true
end
end
function reqs_end()
-- print("LOGO_END")
states:executar("logo")
end
function reqs_update()
if parts[1]<versio_req[1] then
reqs_draw()
elseif parts[2]<versio_req[2] then
reqs_draw()
elseif parts[3]<versio_req[3] then
reqs_draw()
else
states:next()
end
if controller:check("ESC") or controller:check("shoot") then
sys.quit()
end
end
states:registrar("check-reqs",{reqs_init, reqs_update, reqs_end})