- [NEW] Música per a l'imp

- [NEW] Escena amb l'imp
- [FIX] scenes.lua - La música pot arrancar en qualsevol escena
This commit is contained in:
2026-04-04 00:58:03 +02:00
parent 9ab8c80a56
commit 73122ebb78
8 changed files with 148 additions and 36 deletions

View File

@@ -3,20 +3,31 @@
o2aX = arcade_config.org2arc_escala
avatar_abad_x = 3*o2aX
avatar_abad2_x = 4*o2aX
avatar_abad_x = 6
avatar_abad2_x = 8
avatar_abad_y = 0
avatar_batman_x = 4*o2aX
avatar_batman_y = 48*o2aX
avatar_premiere_x = 69*o2aX
avatar_premiere_y = 20*o2aX
avatar_elalien_x = 3*o2aX
avatar_elalien_y = 16*o2aX
avatar_w = 10*o2aX
avatar_h = 10*o2aX
avatar_batman_x = 8
avatar_batman_y = 96
avatar_premiere_x = 138
avatar_premiere_y = 40
avatar_elalien_x = 6
avatar_elalien_y = 32
avatar_w = 20
avatar_h = 20
avatar_imp_x = 134
avatar_imp_y = 96
scenes={
lluita_imp= {
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eh!?","...","Tu qui eres?"},die=20},
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="abad",text={"","Aaaarrrrgghhh",""},die=20,musica=audio_song_imp},
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Who are you?","Comment tu t'appel?","Quod nomen tibi est?"},die=20},
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="abad",text={"","Grwuuuunnnn",""},die=20},
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Eeeerrrrggggg","Prruuuuuuummm","Uooooorrrr"},die=20},
{x=avatar_imp_x, y=avatar_imp_y,flip=true,audio="abad",text={"","GROOOOAAAARRR",""},die=20},
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"MERDA!!","S'HA ENFADAT!!!","CACAUS A MI!!!!"},die=20},
},
intro_01= {
{x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Ah!, què bo!","Nit de Netflix amb","un bon bol de cacaus!"},die=20},
},
@@ -180,6 +191,22 @@ function playtext(snd)
end
end
function next_scene()
scenes.dnum=scenes.dnum+1
scenes.die=scenes.current_scene[scenes.dnum].die or 0
scenes.step=2
play_music()
-- print("NEXT SCENE")
end
function play_music()
if scenes.current_scene[scenes.dnum].musica then
print("PLAY MUSIC "..scenes.dnum)
music.stop()
music.play(scenes.current_scene[scenes.dnum].musica)
end
end
function draw_scene()
local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8
@@ -287,9 +314,7 @@ function update_scene()
flow:next()
-- end
else
scenes.dnum=scenes.dnum+1
scenes.die=scenes.current_scene[scenes.dnum].die or 0
scenes.step=2
next_scene()
end
end
else
@@ -314,8 +339,9 @@ function update_scene()
end
if scenes.step>8 then
if key.press(keyShoot) or key.press(keyDown) or key.press(keyUp) or key.press(keyLeft) or key.press(keyRight) or key.press(key.RETURN) or
pad.press(btnShoot) or pad.press(btnDown) or pad.press(btnUp) or pad.press(btnLeft) or pad.press(btnRight) then
if controller:check("shoot") or controller:check("down") or
controller:check("up") or controller:check("left") or
controller:check("right") or key.press(key.RETURN) then
if scenes.dnum==#scenes.current_scene then
music.stop()
-- if batman.endgame then
@@ -326,8 +352,9 @@ function update_scene()
flow:next()
-- end
else
scenes.dnum=scenes.dnum+1
scenes.step=2
-- scenes.dnum=scenes.dnum+1
-- scenes.step=2
next_scene()
end
end
elseif key.press(keyShoot) or pad.press(btnShoot) then