- abad interaction scenes

This commit is contained in:
2022-11-02 18:58:07 +01:00
parent b738cec630
commit 5c75bf9ab5
6 changed files with 106 additions and 16 deletions

View File

@@ -111,11 +111,18 @@ function elalien.update_normal()
if elalien.hab==abad.hab then if elalien.hab==abad.hab then
if aabb(abad,elalien) then if aabb(abad,elalien) then
if not elalien.scene_intro then if not elalien.scene_intro then
start_scene(scenes.elalien_intro) if abad.objects.peu~=nil then
elalien.scene_intro=true start_scene(scenes.elalien_intro_peu)
elseif not elalien.scene_object and abad.objects.gorro~=nil then
start_scene(scenes.elalien_gorro)
elalien.scene_object=true elalien.scene_object=true
else
start_scene(scenes.elalien_intro)
end
elalien.scene_intro=true
elseif not elalien.scene_object and abad.objects.peu~=nil then
start_scene(scenes.elalien_peu)
elalien.scene_object=true
abad.objects.clau_elalien=true
abad.objects.peu=nil
end end
end end
end end

View File

@@ -17,6 +17,11 @@ function gorro.update()
if gorro.hab==abad.hab then if gorro.hab==abad.hab then
if aabb(abad,gorro) then if aabb(abad,gorro) then
abad.objects.gorro=true abad.objects.gorro=true
if premiere.scene_intro then
start_scene(scenes.gorro_trobat)
else
start_scene(scenes.gorro_trobat_nointro)
end
if abad.objects.gps~=nil then current_camera=3 end if abad.objects.gps~=nil then current_camera=3 end
remove_actor(gorro) remove_actor(gorro)
end end

View File

@@ -17,6 +17,11 @@ function peu.update()
if peu.hab==abad.hab then if peu.hab==abad.hab then
if aabb(abad,peu) then if aabb(abad,peu) then
abad.objects.peu=true abad.objects.peu=true
if elalien.scene_intro then
start_scene(scenes.peu_trobat)
else
start_scene(scenes.peu_trobat_nointro)
end
if abad.objects.gps~=nil then current_camera=4 end if abad.objects.gps~=nil then current_camera=4 end
remove_actor(peu) remove_actor(peu)
end end

View File

@@ -54,11 +54,18 @@ function premiere.update_normal()
if premiere.hab==abad.hab then if premiere.hab==abad.hab then
if aabb(abad,premiere) then if aabb(abad,premiere) then
if not premiere.scene_intro then if not premiere.scene_intro then
if abad.objects.gorro~=nil then
start_scene(scenes.premiere_intro_gorro)
premiere.scene_object=true
else
start_scene(scenes.premiere_intro) start_scene(scenes.premiere_intro)
end
premiere.scene_intro=true premiere.scene_intro=true
elseif not premiere.scene_object and abad.objects.gorro~=nil then elseif not premiere.scene_object and abad.objects.gorro~=nil then
start_scene(scenes.premiere_gorro) start_scene(scenes.premiere_gorro)
premiere.scene_object=true premiere.scene_object=true
abad.objects.clau_premiere=true
abad.objects.gorro=nil
end end
end end
end end

View File

@@ -1,23 +1,86 @@
scenes={ scenes={
abad_inici={ abad_inici={
{x=4,y=0,flip=false,text={"Be, millor comence a","buscar... com s'eixia","d'esta habitació???"}}, {x=4,y=0,flip=false,text={"Se va a enterar eixe","imbècil de Batman","quan el pille..."}},
{x=4,y=0,flip=true,text={"Perque parles","tu soles?",""}}, {x=4,y=0,flip=false,text={"Gonna per el GPS","per a trobarlo.",""}},
{x=4,y=0,flip=false,text={"Pa que Doc prove","com queden els","diàlegs..."}} {x=4,y=0,flip=false,text={"I igual hi ha","algú més per ací","que em puga ajudar."}},
}, },
abad_corfes={ abad_corfes={
{x=4,y=0,flip=false,text={"Osti, està ple de","monstruacos.",""}}, {x=4,y=0,flip=false,text={"Osti, està ple de","monstruacos.",""}},
{x=4,y=0,flip=false,text={"Pos al que s'acoste","s'endurà una corfa","de cacau al cap!"}} {x=4,y=0,flip=false,text={"Pos al que s'acoste","s'endurà una corfa","de cacau al cap!"}}
} },
--premiere_intro={x=4,y=0,text={"Be, millor me fique a","buscar... com s'eixia","d'esta habitacio???"}} premiere_intro={
{x=4,y=0,flip=false,text={"Premiere??","Qué fas per ma casa?",""}},
{x=69,y=20,flip=true,text={"Porca miseria!!","l'uomo pipistrello!!","m'ha llevatto il gorro!"}},
{x=4,y=0,flip=false,text={"Pipistrello??","Això ques??",""}},
{x=69,y=20,flip=true,text={"Il batmano!!","Incontrame il gorro","per l'amore d'un porco!"}},
{x=4,y=0,flip=false,text={"Tinc faena. A mi m'ha","furtat els cacaus i","he de trobarlos."}},
{x=69,y=20,flip=true,text={"Lei tenne in su quarto!","Io tengo micha clave!","Achudame i t'achudo!"}}
},
premiere_intro_gorro={
{x=4,y=0,flip=false,text={"Premiere??","Qué fas per ma casa?",""}},
{x=69,y=20,flip=true,text={"Porca miseria!!","l'uomo pipistrello!!","m'ha llevatto il gorro!"}},
{x=4,y=0,flip=false,text={"Pipistrello??","Això... be, te igual","Ací el tens, atontat."}},
{x=69,y=20,flip=true,text={"Per fortuna!","Grazie mille!","Come podo achudarte?"}},
{x=4,y=0,flip=false,text={"Pos Batman m'ha furtat","els cacaus. Supose que","els te amagats."}},
{x=69,y=20,flip=true,text={"In lo suo quarto!","Io tengo micha clave!","Tenne, tenne!!"}}
},
premiere_gorro={
{x=4,y=0,flip=false,text={"Tin, el ditxos gorro.","",""}},
{x=69,y=20,flip=true,text={"Bravissimo!","Che giornatta","fantastica! Figo!"}},
{x=4,y=0,flip=false,text={"Tu si que eres un","figo. On està eixa","mitja clau?"}},
{x=69,y=20,flip=true,text={"Giusto! Aquí tenne!","Buona fortuna per","la tua avventura!"}},
{x=69,y=20,flip=true,text={"E NON TOCARE il","Batmano! Sei molto","poderoso!"}}
},
gorro_trobat_nointro={
{x=4,y=0,flip=false,text={"Mira, el gorro","de Premiere.","Millor l'agafe."}}
},
gorro_trobat={
{x=4,y=0,flip=false,text={"Mira, el gorro","de Premiere.","A la saca."}}
},
elalien_intro={
{x=4,y=0,flip=false,text={"Que passa alien?","A tu també t'ha","putejat el Batman?"}},
{x=3,y=16,flip=true,text={"CAGUEN L'OU!!","ESTAVA JO TAN TRANQUIL","PODANT AL MEU GOS..."}},
{x=3,y=16,flip=true,text={"...I QUAN NO MIRABA","M'HA FURTAT EL","MARANÀ!!!"}},
{x=4,y=0,flip=false,text={"Es...taves podant","a un gos...?",""}},
{x=3,y=16,flip=true,text={"EN JUPITER NO POTS","DEIXAR QUE LI CREIXEN","MES DE 12 PATES!!"}},
{x=4,y=0,flip=false,text={"Uh... clar...","A mi m'ha furtat","els cacaus."}},
{x=3,y=16,flip=true,text={"ELS TÉ EN LA SEUA","HABITACIÓ SEGUR.","TROBA EL BERENAR..."}},
{x=3,y=16,flip=true,text={"...I JO ET DONARÉ","LA MEITAT DE LA CLAU","PER A ENTRAR."}}
},
elalien_intro_peu={
{x=4,y=0,flip=false,text={"Que passa alien?","A tu també t'ha","putejat el Batman?"}},
{x=3,y=16,flip=true,text={"CAGUEN L'OU!!","ESTAVA JO TAN TRANQUIL","PODANT AL MEU GOS..."}},
{x=3,y=16,flip=true,text={"...I QUAN NO MIRABA","M'HA FURTAT EL","MARANÀ!!!"}},
{x=4,y=0,flip=false,text={"Podant...? be, te","igual. Açò deu ser","el teu berenar."}},
{x=3,y=16,flip=true,text={"OSTI QUE BÓ!!!","GRACIES AUELO!","A TU QUE T'HA FET?"}},
{x=4,y=0,flip=false,text={"M'ha furtat els cacaus.","Segur que els té","al seu quarto."}},
{x=3,y=16,flip=true,text={"SEGUR! PERO JO TINC","LA MEITAT DE LA CLAU.","TIN, I SORT!"}}
},
elalien_peu={
{x=4,y=0,flip=false,text={"Ací tens...","Uff, que peste fa...",""}},
{x=3,y=16,flip=true,text={"GRACIES!!!","SÍ, EH? QUE","SUCOSET I BÓ."}},
{x=4,y=0,flip=false,text={"Clar...","Be, i eixa","mitja clau?"}},
{x=3,y=16,flip=true,text={"TIN! QUAN TINGUES","ELS CACAUS, PEGA-LI","CACAUÀ A BATMAN!"}},
},
peu_trobat_nointro={
{x=4,y=0,flip=false,text={"Un peu podrit??","Qué asco!! Segur","que és d'el alien."}}
},
peu_trobat={
{x=4,y=0,flip=false,text={"Joer, açò deu ser","el berenar d'el alien.","Ecs..."}}
},
habitacio_batman={
{x=4,y=0,flip=false,text={"L'habitació de Batman!","Segur que els cacaus","estàn ahí dins."}},
{x=4,y=0,flip=false,text={"Però necessite","una clau...",""}}
},
} }
function start_scene(scene) function start_scene(scene)
bkg=newsurf(128,96) --bkg=newsurf(128,96)
setdest(bkg) --setdest(bkg)
setsource(0) --setsource(0)
sspr(0,0,128,96,0,0) --sspr(0,0,128,96,0,0)
setsource(tiles) --setsource(tiles)
setdest(0) --setdest(0)
_update=update_scene _update=update_scene
scenes.current_scene=scene scenes.current_scene=scene
scenes.dnum=1 scenes.dnum=1
@@ -110,7 +173,7 @@ function update_scene()
if btnp(KEY_SPACE) then if 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
freesurf(bkg) --freesurf(bkg)
_update=update_game _update=update_game
else else
scenes.dnum=scenes.dnum+1 scenes.dnum=scenes.dnum+1

View File

@@ -35,4 +35,7 @@ function score.draw()
if abad.objects.gorro~=nil then sspr(96,32,16,16,99,44) end if abad.objects.gorro~=nil then sspr(96,32,16,16,99,44) end
if abad.objects.peu~=nil then sspr(112,32,16,16,109,44) end if abad.objects.peu~=nil then sspr(112,32,16,16,109,44) end
if abad.objects.gps~=nil then sspr(112,48,16,16,100,55) end if abad.objects.gps~=nil then sspr(112,48,16,16,100,55) end
if abad.objects.clau_premiere~=nil then sspr(112,8,8,8,104,48) end
if abad.objects.clau_elalien~=nil then sspr(120,8,8,8,112,48) end
end end