- Last scenes

- Last corrections
- Final cutscene almost finished
This commit is contained in:
2022-12-29 14:06:12 +01:00
parent 5a27c54cb3
commit 48f61a8b66
11 changed files with 195 additions and 10 deletions

View File

@@ -13,3 +13,4 @@ audio_text_elalien="t9v1o3l0g#o5c#"
audio_text_batman="t9v1o2l0ag#" audio_text_batman="t9v1o2l0ag#"
audio_life_lost="t5v3c#v2o5c#v1o4c#o5c#v3o3g#v2o4g#v1o3g#o4g#v3o3ev2o4ev1o3eo4ev3o3g#v2o4g#v1o3g#o4g#v3o3c#v2o4c#v1o3c#o4c#" audio_life_lost="t5v3c#v2o5c#v1o4c#o5c#v3o3g#v2o4g#v1o3g#o4g#v3o3ev2o4ev1o3eo4ev3o3g#v2o4g#v1o3g#o4g#v3o3c#v2o4c#v1o3c#o4c#"
audio_game_over="t5v3c#v2o5c#v1o4c#o5c#v3l1ro3l0g#v2o4g#v3o3gv2o4gv3o3g#v2o4g#v3o3av2o4av1o3ao4av3l1ro3l0g#v2o4g#v1o3g#o4g#v3l1rv4l4rv3l0cv2o5cv1o4co5crv3ro4c#v2o5c#v1o4c#o5c#" audio_game_over="t5v3c#v2o5c#v1o4c#o5c#v3l1ro3l0g#v2o4g#v3o3gv2o4gv3o3g#v2o4g#v3o3av2o4av1o3ao4av3l1ro3l0g#v2o4g#v1o3g#o4g#v3l1rv4l4rv3l0cv2o5cv1o4co5crv3ro4c#v2o5c#v1o4c#o5c#"
audio_final="t9v4l0o2fco1f#o0g#l6ro2l0fv3fv2fv1fv4l4rl0rv1rv4fv3fv2fv1fv4fco1f#o0g#l3ro2l0fco1f#o0g#l3ro2l0fv3fv2fv1fl6r="

View File

@@ -19,6 +19,7 @@ end
function batman.hit() function batman.hit()
if abad.objects.bol~=nil then if abad.objects.bol~=nil then
-- Start end of the game -- Start end of the game
start_scene(scenes.final)
end end
end end

View File

@@ -41,7 +41,7 @@ function dead.update()
if (dead.count>250 and btnp(KEY_SPACE)) or dead.count>500 then if (dead.count>250 and btnp(KEY_SPACE)) or dead.count>500 then
game_exit() game_exit()
game_init() game_init(true)
--_init() --_init()
--_update=update_game --_update=update_game
end end

127
final.lua Normal file
View File

@@ -0,0 +1,127 @@
final_rooms = {2,6,60,21,49,23,66,32,4,46,39,55,74}
function final_init()
actors={}
cameras={}
current_actor=1
--table.insert(actors,zombie.new(2,24,24,false))
abad.update = abad_nop
_update=update_final
next_actor()
play(audio_final)
end
function update_final()
cls(16)
camera(-16,-41)
mapa_draw(final_room)
draw_actor()
camera(0,0)
rectfill(0,0,14,96,16)
rectfill(114,0,191,96,16)
rect(15,40,113,89,2)
text("C A C A U S", 42, 12, 15)
text(actor.name, 64-(#actor.name*2), 28, 11)
mapa_update(abad.hab,final_room)
if btnp(KEY_M) then
mute = not mute
if mute then
stopchirp()
else
play(audio_final)
end
end
end
function init_actor(name,flipped,w,h,anim)
actor={name=name,flip=flipped,w=w,h=h,anim=anim,frame=0,wait=0,step=0}
actor.y=40-h
actor.center_count=20
actor.frame=actor.anim[1]
if #anim==1 then
actor.x=48-w/2
actor.center_count=40
elseif flipped then
actor.x=96
else
actor.x=-actor.w
end
end
function draw_actor()
actor.wait=actor.wait+1
if actor.wait==6 or (actor.wait==3 and current_actor==7) then
actor.wait=0
if actor.x == 48-actor.w/2 and actor.center_count>0 then
actor.center_count=actor.center_count-1
actor.frame=actor.anim[1]
else
actor.step=actor.step+1
if actor.step >= #actor.anim then actor.step=0 end
actor.frame=actor.anim[actor.step+1]
if #actor.anim>1 then
if actor.flip then
actor.x=actor.x-2
else
actor.x=actor.x+2
end
end
if current_actor==7 then
actor.y=28-abs(sin(actor.x*0.1))*24
end
if actor.x>96 or actor.x<-actor.w or (#actor.anim==1 and actor.center_count==0) then
next_actor()
end
end
end
local tpl=128/actor.w
sspr((actor.frame%tpl)*actor.w,flr(actor.frame/tpl)*actor.h,actor.w,actor.h,actor.x,actor.y,actor.w,actor.h,actor.flip)
end
function next_actor()
if current_actor==1 then
init_actor("ZOMBIE",false,16,16,{16,17,16,18})
elseif current_actor==2 then
init_actor("CACODEMON",true,16,16,{19,19,19,19,19,19,19,19,19,19,19,19,20,21})
actor.y=16
elseif current_actor==3 then
init_actor("GPS",false,16,16,{31})
actor.y=16
elseif current_actor==4 then
init_actor("IMP",false,16,16,{28,29,28,30})
elseif current_actor==5 then
init_actor("GORRO DE PREMIERE",false,16,16,{22})
elseif current_actor==6 then
init_actor("BAMBOLLA DE CAFÉ",true,16,16,{15,15})
elseif current_actor==7 then
init_actor("PEU DE PACO",false,16,16,{23})
elseif current_actor==8 then
init_actor("PREMIERE",false,16,16,{12,13,12,14})
elseif current_actor==9 then
init_actor("CLAU",false,16,8,{15})
elseif current_actor==10 then
init_actor("EL_ALIEN",true,16,16,{8,9,8,10})
elseif current_actor==11 then
init_actor("BOL DE CACAUS",false,16,8,{95})
elseif current_actor==12 then
init_actor("BATMAN",false,16,16,{24,25,24,26})
elseif current_actor==13 then
init_actor("EL ABAD",true,16,16,{0,1,0,2})
end
final_room=final_rooms[current_actor]
current_actor=current_actor+1
end
---bol de cacaus
--batman
--abad

View File

@@ -2,4 +2,4 @@ title=Cacaus
width=128 width=128
height=96 height=96
zoom=5 zoom=5
files=audio.lua,dead.lua,scenes.lua,trigger.lua,score.lua,switches.lua,map.lua,mapa.lua,bol.lua,invisible.lua,gota.lua,fireball.lua,cacau.lua,bambolla.lua,imp.lua,gps.lua,peu.lua,gorro.lua,batman.lua,elalien.lua,premiere.lua,caco.lua,zombie.lua,abad.lua,intro.lua,game.lua,main.lua files=final.lua,audio.lua,dead.lua,scenes.lua,trigger.lua,score.lua,switches.lua,map.lua,mapa.lua,bol.lua,invisible.lua,gota.lua,fireball.lua,cacau.lua,bambolla.lua,imp.lua,gps.lua,peu.lua,gorro.lua,batman.lua,elalien.lua,premiere.lua,caco.lua,zombie.lua,abad.lua,intro.lua,game.lua,main.lua

View File

@@ -99,6 +99,14 @@ function game_init(menu)
-- TRIGGERS -- TRIGGERS
if not menu then table.insert(actors,trigger.new(10,44,32,triggers.escena_abad_inici)) end if not menu then table.insert(actors,trigger.new(10,44,32,triggers.escena_abad_inici)) end
table.insert(actors,trigger.new(11,16,32,triggers.escena_abad_corfes)) table.insert(actors,trigger.new(11,16,32,triggers.escena_abad_corfes))
table.insert(actors,trigger.new(31,12,32,triggers.escena_abad_portes))
table.insert(actors,trigger.new(31,48,32,triggers.escena_abad_portes))
table.insert(actors,trigger.new(71,56,24,triggers.escena_abad_portes))
table.insert(actors,trigger.new(53,40,32,triggers.escena_abad_porta_casa))
table.insert(actors,trigger.new(56,32,32,triggers.escena_abad_porta_batman))
table.insert(actors,trigger.new(19,32,32,triggers.escena_habitacio_batman)) table.insert(actors,trigger.new(19,32,32,triggers.escena_habitacio_batman))
score.create() score.create()
@@ -315,11 +323,11 @@ function update_menu()
end end
cls(16) cls(16)
text("C A C A U S", 40, 12, 15) text("C A C A U S", 42, 12, 15)
if menu_count<20 then if menu_count<20 then
text("Pulsa SPACE", 40, 28, 13) text("Pulsa SPACE", 42, 28, 13)
else else
text("Pulsa SPACE", 40, 28, 16) text("Pulsa SPACE", 42, 28, 16)
if menu_count>40 then menu_count=0 end if menu_count>40 then menu_count=0 end
end end
draw_hab(menu_room,16,41) draw_hab(menu_room,16,41)

View File

@@ -18,7 +18,7 @@ function intro_intro()
--text("JAILGAMES",40,30,15) --text("JAILGAMES",40,30,15)
text("presenta",48,50,14) text("presenta",48,50,14)
intro_wait=intro_wait-1 intro_wait=intro_wait-1
if intro_wait==0 or btnp(KEY_ESCAPE) then if intro_wait==0 or btnp(KEY_ESCAPE) or btnp(KEY_SPACE) then
cls(16) cls(16)
rect(15,3,113,53,2) rect(15,3,113,53,2)
camera(-16,-4) camera(-16,-4)

View File

@@ -6,8 +6,10 @@ function _init()
logo=newsurf(36,5) logo=newsurf(36,5)
back=newsurf(128,96) back=newsurf(128,96)
--game_init() --game_init()
intro_init() --intro_init()
final_init()
end end
function _update() end function _update() end

View File

@@ -26,6 +26,18 @@ scenes={
{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=audio_text_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=audio_text_abad,text={"I si van altets","igual val la pena","ajupir-se..."}}
}, },
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=audio_text_abad,text={"A saber on està","cada interruptor","per a obrir-les..."}},
},
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=audio_text_abad,text={"Però he de eixir!","Batman viu en la","casa de davant!"}},
},
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=audio_text_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=audio_text_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=audio_text_abad,text={"polsant les tecles","del 1 al 5",""}},
@@ -99,9 +111,21 @@ scenes={
{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=audio_text_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=audio_text_abad,text={"Ara si que li puc","pegar una bona","cacauà..."}}
}, },
final= {
{x=4,y=48,flip=true,audio=audio_text_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=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=audio_text_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=audio_text_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=audio_text_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=audio_text_abad,text={"M'atreviré a","passar l'última","frontera...?"},die=40},
},
} }
function start_scene(scene,offset,die) function start_scene(scene,offset)
--bkg=newsurf(128,96) --bkg=newsurf(128,96)
--setdest(bkg) --setdest(bkg)
--setsource(0) --setsource(0)

View File

@@ -3,7 +3,7 @@ switches={
wait=0, wait=0,
current_list=nil, current_list=nil,
current_index=-1, current_index=-1,
[0]={[0]={20, 53,41}}, [1]={[0]={20, 53,41}},
[11]={[21]={11, 57,45}}, [11]={[21]={11, 57,45}},
[35]={[14]={32, 50,38,26,53,41,29}}, [35]={[14]={32, 50,38,26,53,41,29}},
[53]={[14]={72, 42,30}}, [53]={[14]={72, 42,30}},

View File

@@ -33,6 +33,28 @@ function triggers:escena_abad_corfes()
remove_actor(self) remove_actor(self)
end end
function triggers:escena_abad_portes()
if abad.escena_portes==nil and ((abad.hab==31 and mapa_get_tile(abad.hab,2,4)~=256) or (abad.hab==71 and mapa_get_tile(abad.hab,6,3)~=256)) then
start_scene(scenes.abad_portes)
end
abad.escena_portes=true
remove_actor(self)
end
function triggers:escena_abad_porta_casa()
if mapa_get_tile(abad.hab,6,4)~=256 then
start_scene(scenes.abad_porta_casa)
end
remove_actor(self)
end
function triggers:escena_abad_porta_batman()
if mapa_get_tile(abad.hab,5,4)~=256 then
start_scene(scenes.abad_porta_batman)
end
remove_actor(self)
end
function triggers:escena_habitacio_batman() function triggers:escena_habitacio_batman()
if abad.objects.clau_premiere~=nil and abad.objects.clau_elalien~=nil then if abad.objects.clau_premiere~=nil and abad.objects.clau_elalien~=nil then
switches.start(0,0) switches.start(0,0)