[FIX] Sistema de navegació entre pantalles (flow)

- Optimitzat el logo. Ara necessita menys memòria aprofitant les funcions de paleta
This commit is contained in:
2026-04-03 15:29:44 +02:00
parent 2564c54b3e
commit ca0393046e
8 changed files with 147 additions and 95 deletions

View File

@@ -3,11 +3,11 @@ local logo_step_wait=0
local logo_anim={}
local step1_finished = false
local brillo_y = 10
local logo_wait = 400
local logo_wait = 500
local logo_sf = 99
local font_sf = 99
local logo_sf_w = 63
local logo_sf_h = 30
local logo_sf_h = 20
function logo_anim_init ()
logo_anim={ [1] = {x0=-126, y=80, w=126, h=4, speed= 1, accel= 0.25, x1=65, delay=0},
@@ -35,12 +35,12 @@ function logo_init()
-- Logo
draw.text("JAILGAMES",0,0,15)
draw.text("presenta",0,10,14)
draw.text("JAILGAMES",0,20,2)
-- draw.text("JAILGAMES",0,20,2)
-- Restaurar font
font.current(font_default)
-- Inicialitzar animació
logo_anim_init()
flow:add_path({logo_animate, logo_end})
-- flow:add_path({logo_animate, logo_end})
-- print("LOGO_ANIMATE= ")
-- print(logo_animate)
@@ -49,7 +49,8 @@ function logo_init()
-- Següent bucle
-- game_update = logo_intro
flow:next()
local modul, pas=flow:next()
print("LOGO_INIT= "..modul..", "..pas)
end
function logo_draw()
@@ -88,8 +89,10 @@ function logo_draw()
draw.surf(0,10,55,10, 100,102,55,10); -- presenta
-- if logo_step_wait>=1 then
draw.surf(0,20+math.floor(brillo_y),63,1,
pal.subpal(15,2)
draw.surf(0,0+math.floor(brillo_y),63,1,
logo_anim[1].x0, logo_anim[1].y+math.floor(brillo_y*2), logo_anim[1].w, 1);
pal.subpal(15)
-- end
end
@@ -170,7 +173,7 @@ function logo_end()
-- print("LOGO_END")
-- game_update = intro_init
print("logo_end")
flow:next()
flow:executar("intro")
-- surf.free(logo_sf)
end
@@ -179,14 +182,13 @@ function logo_animate()
logo_wait=logo_wait-1
-- Següent bucle
if logo_wait==0 or key.press(key.ESCAPE) or key.press(keyShoot) or pad.press(btnShoot) or pad.press(btnPause) then
flow:next()
if logo_step==7 or logo_wait==0 or key.press(key.ESCAPE) or key.press(keyShoot) or pad.press(btnShoot) or pad.press(btnPause) then
local modul, pas=flow:next()
print("LOGO_ANIMATE 1= "..modul..", "..pas)
end
logo_draw()
logo_update()
if logo_step==7 then
flow:next()
end
end
flow:registrar("logo",{logo_init, logo_animate, logo_end})