- Musica i so amb SDL_Mixer

This commit is contained in:
2023-01-12 19:01:38 +01:00
parent e47441ee08
commit 1a1ff51a24
34 changed files with 169 additions and 129 deletions

View File

@@ -36,16 +36,16 @@ end
function abad_hurt(howmuch) function abad_hurt(howmuch)
if abad.hurting == 0 and abad.respawning==0 then if abad.hurting == 0 and abad.respawning==0 then
play(audio_abad_hit) playsnd(audio_abad_hit)
abad.energia=abad.energia-howmuch abad.energia=abad.energia-howmuch
if abad.energia<=0 then if abad.energia<=0 then
abad.vides=abad.vides-1 abad.vides=abad.vides-1
if abad.vides==0 then if abad.vides==0 then
--final de la partida --final de la partida
dead.start() dead.start()
play(audio_game_over) playmus(audio_game_over)
else else
play(audio_life_lost) playmus(audio_life_lost)
abad.energia=40 abad.energia=40
abad.hab=abad.safe.hab abad.hab=abad.safe.hab
abad.x=abad.safe.x abad.x=abad.safe.x
@@ -88,13 +88,13 @@ function abad_state_normal()
abad.update=abad_state_jumping abad.update=abad_state_jumping
abad.step=0 abad.step=0
abad.jumpfwd=false abad.jumpfwd=false
play(audio_abad_jump) playsnd(audio_abad_jump)
elseif btn(KEY_DOWN) then elseif btn(KEY_DOWN) then
abad.update=abad_state_crouch abad.update=abad_state_crouch
elseif btn(KEY_Z) then elseif btn(KEY_Z) then
abad.respawning=240 abad.respawning=240
elseif btnp(KEY_SPACE) and cacau.hab==-1 then elseif btnp(KEY_SPACE) and cacau.hab==-1 then
play(audio_abad_shot) playsnd(audio_abad_shot)
abad.update=abad_state_fire abad.update=abad_state_fire
abad.wait=0 abad.wait=0
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip) cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
@@ -162,7 +162,7 @@ function abad_state_walking()
abad.wait=0 abad.wait=0
abad.step=(abad.step+1)%2 abad.step=(abad.step+1)%2
if abad.step==0 then if abad.step==0 then
play(audio_abad_step[abad.mustep]) playsnd(audio_abad_step[abad.mustep])
abad.mustep = abad.mustep + 1 abad.mustep = abad.mustep + 1
if abad.mustep == 5 then abad.mustep=1 end if abad.mustep == 5 then abad.mustep=1 end
end end
@@ -182,7 +182,7 @@ function abad_state_walking()
abad.update=abad_state_jumping abad.update=abad_state_jumping
abad.step=0 abad.step=0
abad.jumpfwd=true abad.jumpfwd=true
play(audio_abad_jump) playsnd(audio_abad_jump)
return return
elseif btn(KEY_DOWN) then elseif btn(KEY_DOWN) then
abad.update=abad_state_crouch abad.update=abad_state_crouch
@@ -244,7 +244,7 @@ function abad_state_jumping()
end end
elseif abad.step>6 then elseif abad.step>6 then
abad.update=abad_state_falling abad.update=abad_state_falling
play(audio_abad_fall) playsnd(audio_abad_fall)
end end
abad.step=abad.step+1 abad.step=abad.step+1
end end

View File

@@ -1,16 +1,20 @@
audio_main_song="t7l1cl0rv2cv4o3l1gl0rv2gv4o4l1cl0rv2cv4l1d#l0rv2d#v4l1dl0rv2dv4o3l1gl0rv2gv4o4l1dl0rv2dv4l1fl0rv2fv4l1d#l0rv2d#v4l1gl0rv2gv4l1fl0rv2fv4l1gl0rv2gv4l1d#l0rv2d#v4l1gl0rv2gv4l1dl0rv2dv4l1gl0rv2gv4l1cl0rv2cv4o3l1gl0rv2gv4o4l1cl0rv2cv4l1d#l0rv2d#v4l1dl0rv2dv4o3l1gl0rv2gv4o4l1dl0rv2dv4l1fl0rv2fv4l1d#l0rv2d#v4l1gl0rv2gv4l1dl0rv2dv4l1gl0rv2gv4l1cl0rv2cv4l1d#l0rv2d#v4l1fl0rv2fv4l1gl0rv2gv4l1g#l0rv2g#v4l1gl0rv2gv4l1g#l0rv2g#v4l1fl0rv2fv4l1dl0rv2dv4o3l1a#l0rv2a#v4o4l1d#l0rv2d#v4l1fl0rv2fv4l1gl0rv2gv4l1fl0rv2fv4l1gl0rv2gv4l1d#l0rv2d#v4l1cl0rv2cv4o3l1g#l0rv2g#v4o4l1dl0rv2dv4l1d#l0rv2d#v4l1fl0rv2fv4l1d#l0rv2d#v4l1fl0rv2fv4l1dl0rv2dv4o3l1bl0rv2bv4l1gl0rv2gv4o4l1cl0rv2cv4l1dl0rv2dv4l1d#l0rv2d#v4l1dl0rv2dv4l1d#l0rv2d#v4l1cl0rv2cv4o5l1cl0rv2cv4o4l1a#l0rv2a#v4l1g#l0rv2g#v4l1gl0rv2gv4l1a#l0rv2a#v4l1g#l0rv2g#v4l1gl0rv2gv4l1fl0rv2fv4l1g#l0rv2g#v4l1gl0rv2gv4l1fl0rv2fv4l1d#l0rv2d#v4l1gl0rv2gv4l1fl0rv2fv4l1d#l0rv2d#v4l1dl0rv2dv4l1cl0rv2cv4o5l1cl0rv2cv4o4l1gl0rv2gv4o5l1cl0rv2cv4o3l1bl0rv2bv4o4l1bl0rv2bv4l1gl0rv2gv4l1bl0rv2bv4o5l1cl0rv2cv4o4l1gl0rv2gv4l1d#l0rv2d#v4l1gl0rv2gv4l1cl0rv2cv4l1gl0rv2gv4l1fl0rv2fv4l1gl0rv2gv4l1d#l0rv2d#v4l1gl0rv2gv4l1dl0rv2dv4l1gl0rv2gv4l1cv2l0cv4rl1g#l0rv2g#v4l1gl0rv2gv4l1g#l0rv2g#v4l1fl0rv2fv4l1g#l0rv2g#v4l1d#l0rv2d#v4l1g#l0rv2g#v4l1dl0rv2dv4l1fl0rv2fv4l1d#l0rv2d#v4l1fl0rv2fv4l1dl0rv2dv4l1fl0rv2fv4l1cl0rv2cv4l1fl0rv2fv4o3l1a#l0rv2a#v4o4l1gl0rv2gv4l1fl0rv2fv4l1gl0rv2gv4l1d#l0rv2d#v4l1gl0rv2gv4l1dl0rv2dv4l1gl0rv2gv4l1cl0rv2cv4o5l1cl0rv2cv4o4l1a#l0rv2a#v4o5l1cl0rv2cv4o4l1g#l0rv2g#v4o5l1cl0rv2cv4o4l1gl0rv2gv4o5l1cl0rv2cv4o4l1fl0rv2fv4l1a#l0rv2a#v4l1g#l0rv2g#v4l1a#l0rv2a#v4l1gl0rv2gv4l1a#l0rv2a#v4l1fl0rv2fv4l1a#l0rv2a#v4l1d#l0rv2d#v4l1g#l0rv2g#v4l1gl0rv2gv4l1g#l0rv2g#v4l1fl0rv2fv4l1g#l0rv2g#v4l1d#l0rv2d#v4l1g#l0rv2g#v4l1dl0rv2dv4l1gl0rv2gv4l1fl0rv2fv4l1gl0rv2gv4o5l1cl0rv2cv4o4l1a#l0rv2a#v4l1g#l0rv2g#v4l1gv2l0rgv4l1a#l0rv2a#v4l1g#l0rv2g#v4l1gl0rv2gv4l1fl0rv2fv4l1g#l0rv2g#v4l1gl0rv2gv4l1fl0rv2fv4l1d#l0rv2d#v4l1gl0rv2gv4l1fl0rv2fv4l1d#l0rv2d#v4l1dl0rv2dv4l1cl0rv2cv4o5l1cl0rv2cv4o4l1gl0rv2gv4o5l1cl0rv2cv4o3l1bl0rv2bv4o4l1bl0rv2bv4l1gl0rv2gv4l1bl0rv2bv4o5l1cl0rv2cv4o4l1gl0rv2gv4l1d#l0rv2d#v4l1gl0rv2gv4l3cv3cv2cv1c" audio_main_song="mus_menu.ogg"
audio_abad_jump="v1l1rl0c#dd#eff#gg#" audio_song_batman="mus_batm.ogg"
audio_abad_fall="v1l1rl0g#gf#fed#dc#" audio_song_premiere="mus_prem.ogg"
audio_abad_step={"t9w2v2l1o3c#", "t9w2v2l1o4c#", "t9w2v2l1o3g#", "t9w2v2l1o4c#"} audio_song_elalien="mus_alie.ogg"
audio_switch="t5v3o7l0ev4rv5o0a#aa#aa#aa#a" audio_life_lost="mus_life.ogg"
audio_abad_hit="t5v3o3l0cv2cv1c" audio_game_over="mus_over.ogg"
audio_abad_shot="t5v1o5l0d#o4a#d#" audio_final=audio_main_song
audio_hit="t5l0v3nv2nv1n"
audio_low="t5l0v3n" audio_abad_jump="snd_ajmp.wav"
audio_text_abad="t9v1l0o4d#" audio_abad_fall="snd_afal.wav"
audio_text_premiere="t9v1l0o5a#" audio_abad_hit="snd_ahit.wav"
audio_text_elalien="t9v1o3l0g#o5c#" audio_abad_shot="snd_asht.wav"
audio_text_batman="t9v1o2l0ag#" audio_abad_step={"snd_ast1.wav", "snd_ast2.wav", "snd_ast3.wav", "snd_ast2.wav"}
audio_life_lost="t5l1v3c#v2o5c#v1o4c#o5c#v3o3g#v2o4g#v1o3g#o4g#v3o3ev2o4ev1o3eo4ev3o3g#v2o4g#v1o3g#o4g#v3o3c#v2o4c#v1o3c#o4c#" audio_switch="snd_swch.wav"
audio_game_over="t5l0v3c#v2o5c#v1o4c#o5c#v3l1ro3l0g#v2o4g#v3o3gv2o4gv3o3g#v2o4g#v3o3av2o4av1o3ao4av3l1ro3l0g#v2o4g#v1o3g#o4g#v3l1rv4l4rv3l0cv2o5cv1o4co5crv3ro4c#v2o5c#v1o4c#o5c#" audio_hit="snd_hit.wav"
audio_final="t9v4l0o2fco1f#o0g#l6ro2l0fv3fv2fv1fv4l4rl0rv1rv4fv3fv2fv1fv4fco1f#o0g#l3ro2l0fco1f#o0g#l3ro2l0fv3fv2fv1fl6r=" audio_low="snd_low.wav"
audio_text_abad="snd_txta.wav"
audio_text_premiere="snd_txtp.wav"
audio_text_elalien="snd_txte.wav"
audio_text_batman="snd_txtb.wav"

View File

@@ -79,7 +79,7 @@ function bambolla.update_normal()
end end
bambolla.y=28-abs(sin(bambolla.x*0.1))*24 bambolla.y=28-abs(sin(bambolla.x*0.1))*24
if bambolla.hab==abad.hab and bambolla.y>25.2 then if bambolla.hab==abad.hab and bambolla.y>25.2 then
play(audio_low) playsnd(audio_low)
end end
if bambolla.hab==abad.hab then if bambolla.hab==abad.hab then
if cacau.hab==bambolla.hab and aabb(bambolla,cacau) then if cacau.hab==bambolla.hab and aabb(bambolla,cacau) then
@@ -89,7 +89,7 @@ function bambolla.update_normal()
bambolla.y=bambolla.y+8 bambolla.y=bambolla.y+8
bambolla.dx=0 bambolla.dx=0
bambolla.dy=-4 bambolla.dy=-4
play(audio_hit) playsnd(audio_hit)
end end
if aabb(bambolla,abad) then if aabb(bambolla,abad) then
abad_hurt(1) abad_hurt(1)

View File

@@ -8,7 +8,7 @@ function final_init()
abad.update = abad_nop abad.update = abad_nop
_update=update_final _update=update_final
next_actor() next_actor()
play(audio_final) playmus(audio_final)
local r,g,b=getcolor(15) local r,g,b=getcolor(15)
setcolor(17,r,g,b) setcolor(17,r,g,b)
--fade.fadein() --fade.fadein()
@@ -36,9 +36,9 @@ function update_final()
if btnp(KEY_M) then if btnp(KEY_M) then
mute = not mute mute = not mute
if mute then if mute then
stopchirp() stopmusic()
else else
play(audio_final) playmus(audio_final)
end end
end end
@@ -144,9 +144,9 @@ function update_final2()
if btnp(KEY_M) then if btnp(KEY_M) then
mute = not mute mute = not mute
if mute then if mute then
stopchirp() stopmusic()
else else
play(audio_final) playmus(audio_final)
end end
end end
final_count=final_count+1 final_count=final_count+1

View File

@@ -20,9 +20,16 @@ function remove_actor(actor)
end end
end end
function play(song) function playmus(song,volume)
if not mute then if not mute then
playchirp(song) playmusic(song,volume)
end
end
function playsnd(sound,volume)
if not mute then
--print(sound)
playsound(sound,volume)
end end
end end
@@ -125,10 +132,10 @@ function game_init(menu)
menu_count=0 menu_count=0
menu_change_room=300 menu_change_room=300
menu_room=rnd(60) menu_room=rnd(60)
play(audio_main_song) playmus(audio_main_song)
else else
_update=update_game _update=update_game
stopchirp() stopmusic()
end end
--fade.fadein() --fade.fadein()
end end
@@ -207,8 +214,6 @@ function update_game()
abad.hab=abad.hab-10 abad.hab=abad.hab-10
elseif btnp(KEY_RETURN) then elseif btnp(KEY_RETURN) then
mode=modes.playing mode=modes.playing
--mapa_do_backup()
--play(audio_main_song);
elseif btnp(KEY_S) and (btn(KEY_LCTRL) or btn(KEY_LGUI)) then elseif btnp(KEY_S) and (btn(KEY_LCTRL) or btn(KEY_LGUI)) then
_update=update_dialog _update=update_dialog
elseif btnp(KEY_C) then elseif btnp(KEY_C) then
@@ -354,9 +359,9 @@ function update_menu()
elseif btnp(KEY_M) then elseif btnp(KEY_M) then
mute = not mute mute = not mute
if mute then if mute then
stopchirp() stopmusic()
else else
play(audio_main_song) playmus(audio_main_song)
end end
end end
end end

View File

@@ -22,7 +22,7 @@ function gota:update_normal()
self.cx=self.x+2 self.cx=self.x+2
self.dx=0 self.dx=0
self.dy=-4 self.dy=-4
if self.hab==abad.hab then play(audio_low) end if self.hab==abad.hab then playsnd(audio_low) end
end end
else else
--self.flip=not self.flip --self.flip=not self.flip

View File

@@ -73,7 +73,7 @@ function imp.update()
imp.x=imp.x-2 imp.x=imp.x-2
if imp.x==78 then if imp.x==78 then
fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip) fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip)
play(audio_hit) playsnd(audio_hit)
imp.flip=not imp.flip imp.flip=not imp.flip
elseif imp.x==-12 then elseif imp.x==-12 then
imp.reset() imp.reset()
@@ -82,7 +82,7 @@ function imp.update()
imp.x=imp.x+2 imp.x=imp.x+2
if imp.x==4 then if imp.x==4 then
fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip) fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip)
play(audio_hit) playsnd(audio_hit)
imp.flip=not imp.flip imp.flip=not imp.flip
elseif imp.x==92 then elseif imp.x==92 then
imp.reset() imp.reset()

View File

@@ -30,9 +30,6 @@ function intro_intro()
end end
function intro_update() function intro_update()
--print("intro_update")
--play(audio_main_song)
--game_init(true)
if btnp(KEY_ESCAPE) then if btnp(KEY_ESCAPE) then
game_init(true) game_init(true)
fade.fadeoutin() fade.fadeoutin()
@@ -95,7 +92,7 @@ function intro_update()
start_scene(scenes.intro_04,58) start_scene(scenes.intro_04,58)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==8 then elseif intro_step==8 then
play(audio_main_song) playmus(audio_main_song)
game_init(true) game_init(true)
fade.fadeoutin() fade.fadeoutin()
end end

View File

@@ -8,6 +8,22 @@ function _init()
back=newsurf(128,96) back=newsurf(128,96)
fade.init() fade.init()
audio_text_abad = loadsound(audio_text_abad)
audio_text_premiere = loadsound(audio_text_premiere)
audio_text_elalien = loadsound(audio_text_elalien)
audio_text_batman = loadsound(audio_text_batman)
audio_abad_jump = loadsound(audio_abad_jump)
audio_abad_fall = loadsound(audio_abad_fall)
audio_abad_hit = loadsound(audio_abad_hit)
audio_abad_shot = loadsound(audio_abad_shot)
audio_abad_step[1] = loadsound(audio_abad_step[1])
audio_abad_step[2] = loadsound(audio_abad_step[2])
audio_abad_step[3] = loadsound(audio_abad_step[3])
audio_abad_step[4] = audio_abad_step[2]
audio_switch = loadsound(audio_switch)
audio_hit = loadsound(audio_hit)
audio_low = loadsound(audio_low)
--game_init() --game_init()
intro_init() intro_init()
--final_init() --final_init()

BIN
mus_alie.ogg Normal file

Binary file not shown.

BIN
mus_batm.ogg Normal file

Binary file not shown.

BIN
mus_life.ogg Normal file

Binary file not shown.

BIN
mus_menu.ogg Normal file

Binary file not shown.

BIN
mus_over.ogg Normal file

Binary file not shown.

BIN
mus_prem.ogg Normal file

Binary file not shown.

View File

@@ -1,127 +1,127 @@
scenes={ scenes={
intro_01= { intro_01= {
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Ah!, que bo!","Nit de Netflix amb","un bon bol de cacaus!"},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Ah!, que bo!","Nit de Netflix amb","un bon bol de cacaus!"},die=20},
}, },
intro_02= { intro_02= {
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Eh! On està el","bol de cacaus???",""},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Eh! On està el","bol de cacaus???",""},die=20},
}, },
intro_03= { intro_03= {
{x=4,y=48,flip=true,audio=audio_text_batman,text={"ME'L HE ENDUT JO!!!", "S'HAN ACABAT ELS","CACAUS PA TU!"},die=20}, {x=4,y=48,flip=true,audio="batman",musica=audio_song_batman,text={"ME'L HE ENDUT JO!!!", "S'HAN ACABAT ELS","CACAUS PA TU!"},die=20},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Qué??","Però perqué???",""},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Qué??","Però perqué???",""},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Estás com una vaca!","Has de deixar de menjar", "eixes gorrinades"},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Estás com una vaca!","Has de deixar de menjar", "eixes gorrinades"},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Mira'm a mí. Estic","tot buenorro i faig", "esport"},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Mira'm a mí. Estic","tot buenorro i faig", "esport"},die=20},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Esport?????","I una merda!!","He de cuidar la panxa!"},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Esport?????","I una merda!!","He de cuidar la panxa!"},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Pos t'aguantes.","Ja pots despedir-te", "dels cacaus..."},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Pos t'aguantes.","Ja pots despedir-te", "dels cacaus..."},die=20},
}, },
intro_04= { intro_04= {
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Serà mamó...","",""},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Serà mamó...","",""},die=20},
}, },
abad_inici={ abad_inici={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Se va a enterar eixe","imbècil de Batman","quan el pille..."}}, {x=4,y=0,flip=false,audio="abad",text={"Se va a enterar eixe","imbècil de Batman","quan el pille..."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Gonna per el GPS","per a trobarlo.",""}}, {x=4,y=0,flip=false,audio="abad",text={"Gonna per el GPS","per a trobarlo.",""}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"I igual hi ha","algú més per ací","que em puga ajudar."}}, {x=4,y=0,flip=false,audio="abad",text={"I igual hi ha","algú més per ací","que em puga ajudar."}},
}, },
abad_corfes={ abad_corfes={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Osti, està ple de","monstruacos.",""}}, {x=4,y=0,flip=false,audio="abad",text={"Osti, està ple de","monstruacos.",""}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Pos al que s'acoste","s'endurà una corfa","de cacau al cap!"}}, {x=4,y=0,flip=false,audio="abad",text={"Pos al que s'acoste","s'endurà una corfa","de cacau al cap!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"I si van altets","igual val la pena","ajupir-se..."}} {x=4,y=0,flip=false,audio="abad",text={"I si van altets","igual val la pena","ajupir-se..."}}
}, },
abad_portes={ abad_portes={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Qui ha tancat totes","les portes?",""}}, {x=4,y=0,flip=false,audio="abad",text={"Qui ha tancat totes","les portes?",""}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"A saber on està","cada interruptor","per a obrir-les..."}}, {x=4,y=0,flip=false,audio="abad",text={"A saber on està","cada interruptor","per a obrir-les..."}},
}, },
abad_porta_casa={ abad_porta_casa={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Vaja, la porta de","casa també està","tancada."}}, {x=4,y=0,flip=false,audio="abad",text={"Vaja, la porta de","casa també està","tancada."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Però he de eixir!","Batman viu en la","casa de davant!"}}, {x=4,y=0,flip=false,audio="abad",text={"Però he de eixir!","Batman viu en la","casa de davant!"}},
}, },
abad_porta_batman={ abad_porta_batman={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Be, era de esperar","que Batman tinguera","la porta tancada."}}, {x=4,y=0,flip=false,audio="abad",text={"Be, era de esperar","que Batman tinguera","la porta tancada."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Crec que hi havia","un passadis secret","del meu sotan al seu."}}, {x=4,y=0,flip=false,audio="abad",text={"Crec que hi havia","un passadis secret","del meu sotan al seu."}},
}, },
gps_trobat={ gps_trobat={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Ale, ja tinc el GPS.","Ara puc trobar tot","el que necessite..."}}, {x=4,y=0,flip=false,audio="abad",text={"Ale, ja tinc el GPS.","Ara puc trobar tot","el que necessite..."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"polsant les tecles","del 1 al 5",""}}, {x=4,y=0,flip=false,audio="abad",text={"polsant les tecles","del 1 al 5",""}},
}, },
premiere_intro={ premiere_intro={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Premiere??","Qué fas per ma casa?",""}}, {x=4,y=0,flip=false,audio="abad",musica=audio_song_premiere,text={"Premiere??","Qué fas per ma casa?",""}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Porca miseria!!","l'uomo pipistrello!!","m'ha llevatto il gorro!"}}, {x=69,y=20,flip=true,audio="premiere",text={"Porca miseria!!","l'uomo pipistrello!!","m'ha llevatto il gorro!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Pipistrello??","Això ques??",""}}, {x=4,y=0,flip=false,audio="abad",text={"Pipistrello??","Això ques??",""}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Il batmano!!","Incontrame il gorro","per l'amore d'un porco!"}}, {x=69,y=20,flip=true,audio="premiere",text={"Il batmano!!","Incontrame il gorro","per l'amore d'un porco!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Tinc faena. A mi m'ha","furtat els cacaus i","he de trobarlos."}}, {x=4,y=0,flip=false,audio="abad",text={"Tinc faena. A mi m'ha","furtat els cacaus i","he de trobarlos."}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Lei tenne in su quarto!","Io tengo micha clave!","Achudame i t'achudo!"}} {x=69,y=20,flip=true,audio="premiere",text={"Lei tenne in su quarto!","Io tengo micha clave!","Achudame i t'achudo!"}}
}, },
premiere_intro_gorro={ premiere_intro_gorro={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Premiere??","Qué fas per ma casa?",""}}, {x=4,y=0,flip=false,audio="abad",musica=audio_song_premiere,text={"Premiere??","Qué fas per ma casa?",""}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Porca miseria!!","l'uomo pipistrello!!","m'ha llevatto il gorro!"}}, {x=69,y=20,flip=true,audio="premiere",text={"Porca miseria!!","l'uomo pipistrello!!","m'ha llevatto il gorro!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Pipistrello??","Això... be, te igual","Ací el tens, atontat."}}, {x=4,y=0,flip=false,audio="abad",text={"Pipistrello??","Això... be, te igual","Ací el tens, atontat."}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Per fortuna!","Grazie mille!","Come podo achudarte?"}}, {x=69,y=20,flip=true,audio="premiere",text={"Per fortuna!","Grazie mille!","Come podo achudarte?"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Pos Batman m'ha furtat","els cacaus. Supose que","els te amagats."}}, {x=4,y=0,flip=false,audio="abad",text={"Pos Batman m'ha furtat","els cacaus. Supose que","els te amagats."}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"In lo suo quarto!","Io tengo micha clave!","Tenne, tenne!!"}} {x=69,y=20,flip=true,audio="premiere",text={"In lo suo quarto!","Io tengo micha clave!","Tenne, tenne!!"}}
}, },
premiere_gorro={ premiere_gorro={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Tin, el ditxos gorro.","",""}}, {x=4,y=0,flip=false,audio="abad",musica=audio_song_premiere,text={"Tin, el ditxos gorro.","",""}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Bravissimo!","Che giornatta","fantastica! Figo!"}}, {x=69,y=20,flip=true,audio="premiere",text={"Bravissimo!","Che giornatta","fantastica! Figo!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Tu si que eres un","figo. On està eixa","mitja clau?"}}, {x=4,y=0,flip=false,audio="abad",text={"Tu si que eres un","figo. On està eixa","mitja clau?"}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"Giusto! Aquí tenne!","Buona fortuna per","la tua avventura!"}}, {x=69,y=20,flip=true,audio="premiere",text={"Giusto! Aquí tenne!","Buona fortuna per","la tua avventura!"}},
{x=69,y=20,flip=true,audio=audio_text_premiere,text={"E NON TOCARE il","Batmano! Sei molto","poderoso!"}} {x=69,y=20,flip=true,audio="premiere",text={"E NON TOCARE il","Batmano! Sei molto","poderoso!"}}
}, },
gorro_trobat_nointro={ gorro_trobat_nointro={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Mira, el gorro","de Premiere.","Millor l'agafe."}} {x=4,y=0,flip=false,audio="abad",text={"Mira, el gorro","de Premiere.","Millor l'agafe."}}
}, },
gorro_trobat={ gorro_trobat={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Mira, el gorro","de Premiere.","A la saca."}} {x=4,y=0,flip=false,audio="abad",text={"Mira, el gorro","de Premiere.","A la saca."}}
}, },
elalien_intro={ elalien_intro={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Que passa alien?","A tu també t'ha","putejat el Batman?"}}, {x=4,y=0,flip=false,audio="abad",musica=audio_song_elalien,text={"Que passa alien?","A tu també t'ha","putejat el Batman?"}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"CAGUEN L'OU!!","ESTAVA JO TAN TRANQUIL","PODANT AL MEU GOS..."}}, {x=3,y=16,flip=true,audio="elalien",text={"CAGUEN L'OU!!","ESTAVA JO TAN TRANQUIL","PODANT AL MEU GOS..."}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"...I QUAN NO MIRABA","M'HA FURTAT EL","MARANÀ!!!"}}, {x=3,y=16,flip=true,audio="elalien",text={"...I QUAN NO MIRABA","M'HA FURTAT EL","MARANÀ!!!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Es...taves podant","a un gos...?",""}}, {x=4,y=0,flip=false,audio="abad",text={"Es...taves podant","a un gos...?",""}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"EN JUPITER NO POTS","DEIXAR QUE LI CREIXEN","MES DE 12 PATES!!"}}, {x=3,y=16,flip=true,audio="elalien",text={"EN JUPITER NO POTS","DEIXAR QUE LI CREIXEN","MES DE 12 PATES!!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Uh... clar...","A mi m'ha furtat","els cacaus."}}, {x=4,y=0,flip=false,audio="abad",text={"Uh... clar...","A mi m'ha furtat","els cacaus."}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"ELS TÉ EN LA SEUA","HABITACIÓ SEGUR.","TROBA EL BERENAR..."}}, {x=3,y=16,flip=true,audio="elalien",text={"ELS TÉ EN LA SEUA","HABITACIÓ SEGUR.","TROBA EL BERENAR..."}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"...I JO ET DONARÉ","LA MEITAT DE LA CLAU","PER A ENTRAR."}} {x=3,y=16,flip=true,audio="elalien",text={"...I JO ET DONARÉ","LA MEITAT DE LA CLAU","PER A ENTRAR."}}
}, },
elalien_intro_peu={ elalien_intro_peu={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Que passa alien?","A tu també t'ha","putejat el Batman?"}}, {x=4,y=0,flip=false,audio="abad",musica=audio_song_elalien,text={"Que passa alien?","A tu també t'ha","putejat el Batman?"}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"CAGUEN L'OU!!","ESTAVA JO TAN TRANQUIL","PODANT AL MEU GOS..."}}, {x=3,y=16,flip=true,audio="elalien",text={"CAGUEN L'OU!!","ESTAVA JO TAN TRANQUIL","PODANT AL MEU GOS..."}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"...I QUAN NO MIRABA","M'HA FURTAT EL","MARANÀ!!!"}}, {x=3,y=16,flip=true,audio="elalien",text={"...I QUAN NO MIRABA","M'HA FURTAT EL","MARANÀ!!!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Podant...? be, te","igual. Açò deu ser","el teu berenar."}}, {x=4,y=0,flip=false,audio="abad",text={"Podant...? be, te","igual. Açò deu ser","el teu berenar."}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"OSTI QUE BÓ!!!","GRACIES AUELO!","A TU QUE T'HA FET?"}}, {x=3,y=16,flip=true,audio="elalien",text={"OSTI QUE BÓ!!!","GRACIES AUELO!","A TU QUE T'HA FET?"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"M'ha furtat els cacaus.","Segur que els té","al seu quarto."}}, {x=4,y=0,flip=false,audio="abad",text={"M'ha furtat els cacaus.","Segur que els té","al seu quarto."}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"SEGUR! PERO JO TINC","LA MEITAT DE LA CLAU.","TIN, I SORT!"}} {x=3,y=16,flip=true,audio="elalien",text={"SEGUR! PERO JO TINC","LA MEITAT DE LA CLAU.","TIN, I SORT!"}}
}, },
elalien_peu={ elalien_peu={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Ací tens...","Uff, que peste fa...",""}}, {x=4,y=0,flip=false,audio="abad",musica=audio_song_elalien,text={"Ací tens...","Uff, que peste fa...",""}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"GRACIES!!!","SÍ, EH? QUE","SUCOSET I BÓ."}}, {x=3,y=16,flip=true,audio="elalien",text={"GRACIES!!!","SÍ, EH? QUE","SUCOSET I BÓ."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Clar...","Be, i eixa","mitja clau?"}}, {x=4,y=0,flip=false,audio="abad",text={"Clar...","Be, i eixa","mitja clau?"}},
{x=3,y=16,flip=true,audio=audio_text_elalien,text={"TIN! QUAN TINGUES","ELS CACAUS, PEGA-LI","CACAUÀ A BATMAN!"}}, {x=3,y=16,flip=true,audio="elalien",text={"TIN! QUAN TINGUES","ELS CACAUS, PEGA-LI","CACAUÀ A BATMAN!"}},
}, },
peu_trobat_nointro={ peu_trobat_nointro={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Un peu podrit??","Qué asco!! Segur","que és d'el alien."}} {x=4,y=0,flip=false,audio="abad",text={"Un peu podrit??","Qué asco!! Segur","que és d'el alien."}}
}, },
peu_trobat={ peu_trobat={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Joer, açò deu ser","el berenar d'el alien.","Ecs..."}} {x=4,y=0,flip=false,audio="abad",text={"Joer, açò deu ser","el berenar d'el alien.","Ecs..."}}
}, },
habitacio_batman={ habitacio_batman={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}}, {x=4,y=0,flip=false,audio="abad",text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Però necessite","una clau...",""}} {x=4,y=0,flip=false,audio="abad",text={"Però necessite","una clau...",""}}
}, },
bol_trobat={ bol_trobat={
{x=4,y=0,flip=false,audio=audio_text_abad,text={"PER FI, JA TINC","ELS MEUS CACAUS!!!","OLE!! OLE!!"}}, {x=4,y=0,flip=false,audio="abad",text={"PER FI, JA TINC","ELS MEUS CACAUS!!!","OLE!! OLE!!"}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Se va a enterar","Batman ara quan","el pille..."}}, {x=4,y=0,flip=false,audio="abad",text={"Se va a enterar","Batman ara quan","el pille..."}},
{x=4,y=0,flip=false,audio=audio_text_abad,text={"Ara si que li puc","pegar una bona","cacauà..."}} {x=4,y=0,flip=false,audio="abad",text={"Ara si que li puc","pegar una bona","cacauà..."}}
}, },
final= { final= {
{x=4,y=48,flip=true,audio=audio_text_batman,text={"AI!", "M'has fet mal!!!",""},die=20}, {x=4,y=48,flip=true,audio="batman",musica=audio_song_batman,text={"AI!", "M'has fet mal!!!",""},die=20},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Aixó per furtar-me","el bol de cacaus,","imbèsil"},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Aixó per furtar-me","el bol de cacaus,","imbèsil"},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Cert, esta me la","mereixia... però", "mira que be estàs!"},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Cert, esta me la","mereixia... però", "mira que be estàs!"},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Amb el que t'ha","costat pillar-me", "t'has ficat en forma"},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Amb el que t'ha","costat pillar-me", "t'has ficat en forma"},die=20},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"No me vingues en","tonteries,","mamarratxo."},die=20}, {x=3,y=0,flip=false,audio="abad",text={"No me vingues en","tonteries,","mamarratxo."},die=20},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"Creus que no he","notat que falta mig","bol de cacaus?"},die=20}, {x=3,y=0,flip=false,audio="abad",text={"Creus que no he","notat que falta mig","bol de cacaus?"},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Jejejeje, es que","estàn molt bons!", ""},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Jejejeje, es que","estàn molt bons!", ""},die=20},
{x=4,y=48,flip=true,audio=audio_text_batman,text={"Però si vols te","done del meu bol", "de tramussos."},die=20}, {x=4,y=48,flip=true,audio="batman",text={"Però si vols te","done del meu bol", "de tramussos."},die=20},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"TRAMUSSOS...","",""},die=10}, {x=3,y=0,flip=false,audio="abad",text={"TRAMUSSOS...","",""},die=10},
{x=3,y=0,flip=false,audio=audio_text_abad,text={"M'atreviré a","passar l'última","frontera...?"},die=40}, {x=3,y=0,flip=false,audio="abad",text={"M'atreviré a","passar l'última","frontera...?"},die=40},
}, },
} }
@@ -139,11 +139,27 @@ function start_scene(scene,offset)
scenes.wait=0 scenes.wait=0
scenes.offset=28 scenes.offset=28
scenes.die=scenes.current_scene[scenes.dnum].die or 0 scenes.die=scenes.current_scene[scenes.dnum].die or 0
if scene[1].musica then
--print(scene[1].musica)
playmus(scenes.current_scene[scenes.dnum].musica, 64)
end
if offset then scenes.offset=offset end if offset then scenes.offset=offset end
old_update=_update old_update=_update
_update=update_scene _update=update_scene
end end
function playtext(snd)
if snd=="abad" then
playsnd(audio_text_abad)
elseif snd=="batman" then
playsnd(audio_text_batman)
elseif snd=="premiere" then
playsnd(audio_text_premiere)
elseif snd=="elalien" then
playsnd(audio_text_elalien)
end
end
function draw_scene() function draw_scene()
local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8 local txt_x = not scenes.current_scene[scenes.dnum].flip and 38 or 8
camera(0,-scenes.offset) camera(0,-scenes.offset)
@@ -180,7 +196,7 @@ function draw_scene()
if scenes.char<#scenes.current_scene[scenes.dnum].text[1] then if scenes.char<#scenes.current_scene[scenes.dnum].text[1] then
scenes.step=scenes.step-1 scenes.step=scenes.step-1
scenes.char=scenes.char+1 scenes.char=scenes.char+1
play(scenes.current_scene[scenes.dnum].audio) playtext(scenes.current_scene[scenes.dnum].audio)
else else
scenes.char=1 scenes.char=1
end end
@@ -189,7 +205,7 @@ function draw_scene()
if scenes.char<#scenes.current_scene[scenes.dnum].text[2] then if scenes.char<#scenes.current_scene[scenes.dnum].text[2] then
scenes.step=scenes.step-1 scenes.step=scenes.step-1
scenes.char=scenes.char+1 scenes.char=scenes.char+1
play(scenes.current_scene[scenes.dnum].audio) playtext(scenes.current_scene[scenes.dnum].audio)
else else
scenes.char=1 scenes.char=1
end end
@@ -198,7 +214,7 @@ function draw_scene()
if scenes.char<#scenes.current_scene[scenes.dnum].text[3] then if scenes.char<#scenes.current_scene[scenes.dnum].text[3] then
scenes.step=scenes.step-1 scenes.step=scenes.step-1
scenes.char=scenes.char+1 scenes.char=scenes.char+1
play(scenes.current_scene[scenes.dnum].audio) playtext(scenes.current_scene[scenes.dnum].audio)
else else
scenes.char=1 scenes.char=1
end end
@@ -231,6 +247,7 @@ function update_scene()
scenes.die=scenes.die-1 scenes.die=scenes.die-1
if scenes.die==0 then if scenes.die==0 then
if scenes.dnum==#scenes.current_scene then if scenes.dnum==#scenes.current_scene then
stopmusic()
if batman.endgame then if batman.endgame then
final_init() final_init()
fade.fadeoutin() fade.fadeoutin()
@@ -255,6 +272,7 @@ function update_scene()
elseif btnp(KEY_SPACE) then elseif btnp(KEY_SPACE) then
if scenes.step>8 then if scenes.step>8 then
if scenes.dnum==#scenes.current_scene then if scenes.dnum==#scenes.current_scene then
stopmusic()
if batman.endgame then if batman.endgame then
final_init() final_init()
fade.fadeoutin() fade.fadeoutin()

BIN
snd_afal.wav Normal file

Binary file not shown.

BIN
snd_ahit.wav Normal file

Binary file not shown.

BIN
snd_ajmp.wav Normal file

Binary file not shown.

BIN
snd_asht.wav Normal file

Binary file not shown.

BIN
snd_ast1.wav Normal file

Binary file not shown.

BIN
snd_ast2.wav Normal file

Binary file not shown.

BIN
snd_ast3.wav Normal file

Binary file not shown.

BIN
snd_hit.wav Normal file

Binary file not shown.

BIN
snd_low.wav Normal file

Binary file not shown.

BIN
snd_swch.wav Normal file

Binary file not shown.

BIN
snd_txta.wav Normal file

Binary file not shown.

BIN
snd_txtb.wav Normal file

Binary file not shown.

BIN
snd_txte.wav Normal file

Binary file not shown.

BIN
snd_txtp.wav Normal file

Binary file not shown.

View File

@@ -20,11 +20,11 @@ function switches.start(hab,tile)
if switches.cooldown>0 then return end if switches.cooldown>0 then return end
mapa_set_tile_by_index(hab,tile,57) mapa_set_tile_by_index(hab,tile,57)
switches.current_list=switches[hab+1][tile] switches.current_list=switches[hab+1][tile]
print(tile) --print(tile)
switches.current_index=2 switches.current_index=2
switches.wait=0 switches.wait=0
switches.cooldown=60 switches.cooldown=60
play(audio_switch) playsnd(audio_switch)
end end
function switches.update() function switches.update()

Binary file not shown.

Binary file not shown.

Binary file not shown.