From 5c75bf9ab527be2758c8c8cbe4db9c54d4bbbe26 Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Wed, 2 Nov 2022 18:58:07 +0100 Subject: [PATCH] - abad interaction scenes --- elalien.lua | 13 ++++++-- gorro.lua | 5 +++ peu.lua | 5 +++ premiere.lua | 9 +++++- scenes.lua | 87 ++++++++++++++++++++++++++++++++++++++++++++-------- score.lua | 3 ++ 6 files changed, 106 insertions(+), 16 deletions(-) diff --git a/elalien.lua b/elalien.lua index c935466..a207a96 100644 --- a/elalien.lua +++ b/elalien.lua @@ -111,11 +111,18 @@ function elalien.update_normal() if elalien.hab==abad.hab then if aabb(abad,elalien) then if not elalien.scene_intro then - start_scene(scenes.elalien_intro) + if abad.objects.peu~=nil then + start_scene(scenes.elalien_intro_peu) + elalien.scene_object=true + else + start_scene(scenes.elalien_intro) + end elalien.scene_intro=true - elseif not elalien.scene_object and abad.objects.gorro~=nil then - start_scene(scenes.elalien_gorro) + 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 diff --git a/gorro.lua b/gorro.lua index bd0896c..ef52182 100644 --- a/gorro.lua +++ b/gorro.lua @@ -17,6 +17,11 @@ function gorro.update() if gorro.hab==abad.hab then if aabb(abad,gorro) then 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 remove_actor(gorro) end diff --git a/peu.lua b/peu.lua index ffac6f2..765dcef 100644 --- a/peu.lua +++ b/peu.lua @@ -17,6 +17,11 @@ function peu.update() if peu.hab==abad.hab then if aabb(abad,peu) then 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 remove_actor(peu) end diff --git a/premiere.lua b/premiere.lua index 76e4aab..c87ad8e 100644 --- a/premiere.lua +++ b/premiere.lua @@ -54,11 +54,18 @@ function premiere.update_normal() if premiere.hab==abad.hab then if aabb(abad,premiere) then if not premiere.scene_intro then - start_scene(scenes.premiere_intro) + if abad.objects.gorro~=nil then + start_scene(scenes.premiere_intro_gorro) + premiere.scene_object=true + else + start_scene(scenes.premiere_intro) + end premiere.scene_intro=true elseif not premiere.scene_object and abad.objects.gorro~=nil then start_scene(scenes.premiere_gorro) premiere.scene_object=true + abad.objects.clau_premiere=true + abad.objects.gorro=nil end end end diff --git a/scenes.lua b/scenes.lua index 871f10e..0daefc5 100644 --- a/scenes.lua +++ b/scenes.lua @@ -1,23 +1,86 @@ scenes={ 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=true,text={"Perque parles","tu soles?",""}}, - {x=4,y=0,flip=false,text={"Pa que Doc prove","com queden els","diàlegs..."}} + {x=4,y=0,flip=false,text={"Se va a enterar eixe","imbècil de Batman","quan el pille..."}}, + {x=4,y=0,flip=false,text={"Gonna per el GPS","per a trobarlo.",""}}, + {x=4,y=0,flip=false,text={"I igual hi ha","algú més per ací","que em puga ajudar."}}, }, abad_corfes={ {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!"}} - } - --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) - bkg=newsurf(128,96) - setdest(bkg) - setsource(0) - sspr(0,0,128,96,0,0) - setsource(tiles) - setdest(0) + --bkg=newsurf(128,96) + --setdest(bkg) + --setsource(0) + --sspr(0,0,128,96,0,0) + --setsource(tiles) + --setdest(0) _update=update_scene scenes.current_scene=scene scenes.dnum=1 @@ -110,7 +173,7 @@ function update_scene() if btnp(KEY_SPACE) then if scenes.step>8 then if scenes.dnum==#scenes.current_scene then - freesurf(bkg) + --freesurf(bkg) _update=update_game else scenes.dnum=scenes.dnum+1 diff --git a/score.lua b/score.lua index 5cf88a0..f564e55 100644 --- a/score.lua +++ b/score.lua @@ -35,4 +35,7 @@ function score.draw() 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.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 \ No newline at end of file