Compare commits

...

4 Commits

10 changed files with 164 additions and 48 deletions

View File

@@ -105,6 +105,19 @@ actors={
end end
end, end,
moveto=function(name,dx,dy)
local actor = actors.search(name)
if actor.x==dx and actor.y==dy then
actor.path=nil
return
end
actor.path={pos=0,route=""}
if (actor.x<dx) then for i=1,dx-actor.x do actor.path.route=actor.path.route.."r" end end
if (actor.x>dx) then for i=1,actor.x-dx do actor.path.route=actor.path.route.."l" end end
if (actor.y<dy) then for i=1,dy-actor.y do actor.path.route=actor.path.route.."d" end end
if (actor.y>dy) then for i=1,actor.y-dy do actor.path.route=actor.path.route.."u" end end
end,
update=function() update=function()
if actors.updating then return end if actors.updating then return end
actors.updating=true actors.updating=true
@@ -118,7 +131,6 @@ actors={
v.path=nil v.path=nil
game.update() game.update()
if in_scene then scene.cont() end if in_scene then scene.cont() end
v.keys=nil
if v.name == actors.main.name then if v.name == actors.main.name then
local switch = switches.search(v.x,v.y) local switch = switches.search(v.x,v.y)
if switch then if switch then

View File

@@ -20,8 +20,8 @@ game={
restart=function() restart=function()
flags={} flags={}
objects.list={} objects.list={}
actors.main={name="jailer",x=14,y=11,o="l",gfx={x=32,y=0},level="arq"} actors.main={name="jailer",x=9,y=14,o="u",gfx={x=32,y=0},level="repro"}
game.init("arq") game.init("repro")
end, end,
init=function(levelname,f,objs) init=function(levelname,f,objs)
@@ -49,11 +49,11 @@ game={
show_menu=function() show_menu=function()
game.pause() game.pause()
brymode.show(game.resume) --brymode.show(game.resume)
--menu.show({ {"GUARDAR PARTIDA", game.save}, menu.show({ {"GUARDAR PARTIDA", game.save},
-- {"CARREGAR PARTIDA", game.load}, {"CARREGAR PARTIDA", game.load},
-- {"EIXIR", main_init}, {"EIXIR", main_init},
-- }, game.resume) }, game.resume)
end, end,
save=function() save=function()

View File

@@ -11,6 +11,8 @@ levels["arq"]={
actors.add({name="estudiant1",x=18,y=11,o="r",gfx={x=0,y=48},action=levels.arq.estudiant1_action}) actors.add({name="estudiant1",x=18,y=11,o="r",gfx={x=0,y=48},action=levels.arq.estudiant1_action})
actors.add({name="estudiant2",x=16,y=12,o="l",gfx={x=128,y=0},action=levels.arq.estudiant2_action}) actors.add({name="estudiant2",x=16,y=12,o="l",gfx={x=128,y=0},action=levels.arq.estudiant2_action})
actors.add({name="estudiant3",x=34,y=25,o="r",gfx={x=128,y=48},action=levels.arq.estudiant3_action})
actors.add({name="estudiant4",x=27,y=25,o="d",gfx={x=0,y=64},action=levels.arq.estudiant4_action})
actors.add({name="cartel_jail1_a",x=8,y=10,o="",action=levels.arq.cartel_jail1_action}) actors.add({name="cartel_jail1_a",x=8,y=10,o="",action=levels.arq.cartel_jail1_action})
actors.add({name="cartel_jail1_b",x=14,y=10,o="",action=levels.arq.cartel_jail1_action}) actors.add({name="cartel_jail1_b",x=14,y=10,o="",action=levels.arq.cartel_jail1_action})
@@ -22,9 +24,11 @@ levels["arq"]={
actors.add({name="cartel_aula1",x=34,y=24,o="",action=levels.arq.cartel_aula1_action}) actors.add({name="cartel_aula1",x=34,y=24,o="",action=levels.arq.cartel_aula1_action})
actors.add({name="cartel_repro",x=58,y=24,o="",action=levels.arq.cartel_repro_action}) actors.add({name="cartel_repro",x=58,y=24,o="",action=levels.arq.cartel_repro_action})
actors.add({name="tablo_aula2",x=36,y=24,o="",action=levels.arq.tablo_aula1_action})
actors.add({name="tablo_aula2",x=24,y=24,o="",action=levels.arq.tablo_aula2_action}) actors.add({name="tablo_aula2",x=24,y=24,o="",action=levels.arq.tablo_aula2_action})
actors.add({name="tablo_aula3",x=4,y=24,o="",action=levels.arq.tablo_aula3_action})
if not flags.prac3 or not flags.prac2 or not flags.prac1 or flags.prac1~=2 then if not flags.prac3 or not flags.prac2 or not flags.prac1 then
actors.add({name="alutablo1",x=3,y=25,o="d",gfx={x=32,y=64}}) actors.add({name="alutablo1",x=3,y=25,o="d",gfx={x=32,y=64}})
actors.add({name="alutablo2",x=5,y=25,o="d",gfx={x=16,y=96},action=levels.arq.alutablo_action}) actors.add({name="alutablo2",x=5,y=25,o="d",gfx={x=16,y=96},action=levels.arq.alutablo_action})
actors.add({name="alutablo3",x=4,y=26,o="d",gfx={x=48,y=96}}) actors.add({name="alutablo3",x=4,y=26,o="d",gfx={x=48,y=96}})
@@ -124,6 +128,20 @@ levels["arq"]={
end end
}) })
switches.add({x=6,y=25,w=1,h=3,action=
function()
if not flags.prac3 or flags.prac3<2 then
flags.prac3=2
scene.start({
function() balloon.show("MIRA, JA\nS'HA DESPEJAT...",2,"jailer",false,{x=5,w=10,h=2}) end,
})
return true
else
return false
end
end
})
end, end,
prohibit_action=function() prohibit_action=function()
@@ -163,6 +181,24 @@ levels["arq"]={
}) })
end, end,
estudiant3_action=function()
scene.start({
function() actors.face("estudiant3", "jailer") scene.cont() end,
function() balloon.show("EI, QUE HI HA\nEN ESTE PASILLO?",2,"jailer",false,{x=3,w=10,h=2}) end,
function() balloon.show("SON LES AULES\nDE PRÀCTIQUES",12,"estudiant3",false,{x=8,w=9,h=2}) end,
function() balloon.show("PERO NO VAIG A\nENTRAR. ME FAN POR\nELS PROFESORS!",12,"estudiant3",false,{x=7,w=11,h=3}) end,
function() balloon.show("ES UNA ENFERMETAT REAL!\n...PROFAFOBIA!",12,"estudiant3",false,{x=5,w=13,h=2}) end,
function() balloon.show("...O ALGO AIXÍ...",12,"estudiant3",false,{x=7,w=11,h=1}) end,
})
end,
estudiant4_action=function()
scene.start({
function() balloon.show("VOLS SABER EN QUINA\nAULA ES DONA\nCADA ASSIGNATURA?",12,"estudiant4",false,{x=4,w=12,h=3}) end,
function() balloon.show("MIRA LA LLISTA EN\nEL TAULER AL FONDO\nDEL PASILLO",12,"estudiant4",false,{x=5,w=11,h=3}) end,
})
end,
alutablo_action=function() alutablo_action=function()
scene.start({ scene.start({
function() balloon.show("OSTI, ESTÀ PETAT!",2,"jailer",false,{x=2,w=11,h=1}) end, function() balloon.show("OSTI, ESTÀ PETAT!",2,"jailer",false,{x=2,w=11,h=1}) end,
@@ -212,10 +248,23 @@ levels["arq"]={
}) })
end, end,
tablo_aula1_action=function()
scene.start({
function() balloon.show("'WWW.TRIPOD.COM/BORRULL'",2,"jailer",false,{x=1,w=16,h=1}) end,
})
end,
tablo_aula2_action=function() tablo_aula2_action=function()
scene.start({ scene.start({
function() balloon.show("'...BUSCO COMPAÑERO DE PISO\nPREFERIBLEMENTE GATO...'",2,"jailer",false,{x=1,w=16,h=2}) end, function() balloon.show("'...BUSCO COMPAÑERO DE PISO\nPREFERIBLEMENTE GATO...'",2,"jailer",false,{x=1,w=16,h=2}) end,
}) })
end, end,
tablo_aula3_action=function()
flags.apuntes=1
scene.start({
function() balloon.show("AULES DE PRÀCTIQUES\n--------------------------\nDISTRIBUCIÓ D'ASSIGNATURES",2,"jailer",false,{x=1,w=16,h=3}) end,
function() balloon.show("AULA 1: CMC\nAULA 2: ALG\nAULA 3: TCO",2,"jailer",false,{x=3,w=8,h=3}) end,
})
end,
} }

View File

@@ -50,45 +50,45 @@ levels["prac1"]={
end end
}) })
switches.add({x=4,y=14,w=10,h=1,action= switches.add({x=9,y=15,w=1,h=1,action=
function() function()
--flags.prac1=1 --flags.prac1=1
if not flags.prac1 then if not flags.prac1 then
flags.prac1=1 flags.prac1=1
scene.start({ scene.start({
function() balloon.show("OYE TU!",12,"profe",false,{x=4,w=6,h=1}) end, function() balloon.show("OYE TU!",12,"profe",false,{x=4,w=6,h=1}) end,
function() actors.search("profe").path={pos=0,route='rrrdddddd'} end, function() actors.search("profe").path={pos=0,route='rrrddddddd'} end,
function() balloon.show("TE PARECE HORA DE LLEGAR\nA LA PRÁCTICA?",12,"profe",false,{x=3,w=14,h=2}) end, function() balloon.show("TE PARECE HORA DE LLEGAR\nA LA PRÁCTICA?",12,"profe",false,{x=3,w=14,h=2}) end,
function() balloon.show("AL MENOS TENDRÁS\nLOS APUNTES\n¿NO?",12,"profe",false,{x=3,w=14,h=3}) end, function() balloon.show("AL MENOS TENDRÁS\nLOS APUNTES\n¿NO?",12,"profe",false,{x=3,w=14,h=3}) end,
function() balloon.show("PUES...\nNO",2,"jailer",false,{x=5,w=7,h=2}) end, function() balloon.show("PUES...\nNO",2,"jailer",false,{x=5,w=7,h=2}) end,
function() balloon.show("¿¿QUÉ??\n¡ESTO ES EL COLMO!",12,"profe",false,{x=3,w=14,h=2}) end, function() balloon.show("¿¿QUÉ??\n¡ESTO ES EL COLMO!",12,"profe",false,{x=3,w=14,h=2}) end,
function() balloon.show("¡LARGO!\n¡Y NO VUELVAS SIN\nLOS APUNTES!",12,"profe",false,{x=3,w=14,h=3}) end, function() balloon.show("¡LARGO!\n¡Y NO VUELVAS SIN\nLOS APUNTES!",12,"profe",false,{x=3,w=14,h=3}) end,
function() actors.search("jailer").path={pos=0,route='dd'} end function() actors.search("jailer").path={pos=0,route='d'} end
}) })
return true return true
elseif flags.prac1==1 then elseif flags.prac1==1 then
if not objects.search("apuntes_1015") then if not objects.search("apuntes") then
scene.start({ scene.start({
function() balloon.show("¿OTRA VEZ TU?",12,"profe",false,{x=4,w=9,h=1}) end, function() balloon.show("¿OTRA VEZ TU?",12,"profe",false,{x=4,w=9,h=1}) end,
function() actors.search("profe").path={pos=0,route='rrrdddddd'} end, function() actors.search("profe").path={pos=0,route='rrrddddddd'} end,
function() balloon.show("¿TRAES LOS APUNTES?",12,"profe",false,{x=3,w=12,h=1}) end, function() balloon.show("¿TRAES LOS APUNTES?",12,"profe",false,{x=3,w=12,h=1}) end,
function() balloon.show("SI ES QUE NO SÉ\nQUINS SON!",2,"jailer",false,{x=5,w=10,h=2}) end, function() balloon.show("NO...\nES QUE...",2,"jailer",false,{x=5,w=10,h=2}) end,
function() balloon.show("¡PUES TE BUSCAS LAS CASTAÑAS!\n¡HABER VENIDO A CLASE!",12,"profe",false,{x=3,w=16,h=2}) end, function() balloon.show("¡PUES TE BUSCAS LAS CASTAÑAS!\n¡HABER VENIDO A CLASE!",12,"profe",false,{x=3,w=16,h=2}) end,
function() balloon.show("CAGUEN L'OU...",2,"jailer",false,{x=5,w=9,h=1}) end, function() balloon.show("CAGUEN L'OU...",2,"jailer",false,{x=5,w=9,h=1}) end,
function() actors.search("jailer").path={pos=0,route='dd'} end, function() actors.search("jailer").path={pos=0,route='d'} end,
function() wait.start(1.5) end, function() wait.start(1.5) end,
function() balloon.show("SI NO SÉ NI QUINA\nASSIGNATURA ES...",2,"jailer",false,{x=5,w=10,h=2}) end function() if not flags.apuntes then balloon.show("SI NO SÉ NI QUINA\nASSIGNATURA ES...",2,"jailer",false,{x=5,w=10,h=2}) end end
}) })
else else
flags.prac1=2 flags.prac1=2
scene.start({ scene.start({
function() balloon.show("¿OTRA VEZ TU?",12,"profe",false,{x=4,w=6,h=1}) end, function() balloon.show("¿OTRA VEZ TU?",12,"profe",false,{x=4,w=6,h=1}) end,
function() actors.search("profe").path={pos=0,route='rrrdddddd'} end, function() actors.search("profe").path={pos=0,route='rrrddddddd'} end,
function() balloon.show("¿TRAES LOS APUNTES?",12,"profe",false,{x=3,w=14,h=1}) end, function() balloon.show("¿TRAES LOS APUNTES?",12,"profe",false,{x=3,w=14,h=1}) end,
function() balloon.show("¡ACÍ ESTÀN!",2,"jailer",false,{x=5,w=7,h=1}) end, function() balloon.show("¡ACÍ ESTÀN!",2,"jailer",false,{x=5,w=7,h=1}) end,
function() balloon.show("¡AH!\n¡ASÍ ME GUSTA!",12,"profe",false,{x=3,w=14,h=2}) end, function() balloon.show("¡AH!\n¡ASÍ ME GUSTA!",12,"profe",false,{x=3,w=14,h=2}) end,
function() balloon.show("BUSCA UN ORDENADOR\nLIBRE Y EMPIEZA",12,"profe",false,{x=3,w=14,h=2}) end, function() balloon.show("BUSCA UN ORDENADOR\nLIBRE Y EMPIEZA",12,"profe",false,{x=3,w=14,h=2}) end,
function() actors.search("profe").path={pos=0,route='uuuuuullla'} end, function() actors.search("profe").path={pos=0,route='uuuuuuullla'} end,
}) })
end end
return true return true

View File

@@ -68,6 +68,7 @@ levels["prac2"]={
end, end,
profe_action=function() profe_action=function()
if not flags.prac2 then
flags.prac2=1 flags.prac2=1
scene.start({ scene.start({
function() actors.face("profe","jailer") scene.cont() end, function() actors.face("profe","jailer") scene.cont() end,
@@ -77,6 +78,14 @@ levels["prac2"]={
function() actors.search("profe").o="d" scene.cont() end, function() actors.search("profe").o="d" scene.cont() end,
function() balloon.show("NO PUEDO LEVANTARME\nNI PARA IR AL BAÑO...",12,"profe",true,{x=3,w=14,h=2}) end, function() balloon.show("NO PUEDO LEVANTARME\nNI PARA IR AL BAÑO...",12,"profe",true,{x=3,w=14,h=2}) end,
}) })
else
flags.prac2=2
scene.start({
function() actors.face("profe","jailer") scene.cont() end,
function() balloon.show("EN SERIO, NO TENGO,\nTIEMPO PARA TONTERÍAS",12,"profe",true,{x=3,w=14,h=2}) end,
function() actors.search("profe").o="d" scene.cont() end,
})
end
end, end,
alumne1_action=function() alumne1_action=function()

View File

@@ -76,6 +76,7 @@ levels["prac3"]={
profe_action=function() profe_action=function()
local hero = actors.search(actors.main.name) local hero = actors.search(actors.main.name)
if not flags.prac3 then
flags.prac3=1 flags.prac3=1
scene.start({ scene.start({
function() actors.face("profe","jailer") scene.cont() end, function() actors.face("profe","jailer") scene.cont() end,
@@ -86,6 +87,14 @@ levels["prac3"]={
function() actors.search("profe").o="u" scene.cont() end, function() actors.search("profe").o="u" scene.cont() end,
function() balloon.show("MECACHIS...",2,"jailer",true,{x=5,w=8,h=1}) end, function() balloon.show("MECACHIS...",2,"jailer",true,{x=5,w=8,h=1}) end,
}) })
else
scene.start({
function() actors.face("profe","jailer") scene.cont() end,
function() balloon.show("LE HE DICHO QUE\nNO SE PREOCUPE.",12,"profe",true,{x=6,w=11,h=2}) end,
function() balloon.show("SIÉNTESE Y DEJE\nDE HACER LA MONA.",12,"profe",true,{x=6,w=11,h=2}) end,
function() actors.search("profe").o="u" scene.cont() end,
})
end
end, end,
comp_profe_action=function() comp_profe_action=function()

View File

@@ -12,7 +12,7 @@ levels["repro"]={
actors.add({name="comp",x=3,y=6,o="d",gfx={x=96,y=0}}) actors.add({name="comp",x=3,y=6,o="d",gfx={x=96,y=0}})
actors.add({name="impresora",x=5,y=6,o="d",gfx={x=176,y=16}}) actors.add({name="impresora",x=5,y=6,o="d",gfx={x=176,y=16}})
actors.add({name="currante1",x=9,y=11,o="d",gfx={x=16,y=48}}) actors.add({name="currante1",x=9,y=11,o="d",gfx={x=128,y=48}})
actors.add({name="currante2",x=4,y=5,o="d",gfx={x=16,y=80}}) actors.add({name="currante2",x=4,y=5,o="d",gfx={x=16,y=80}})
switches.add({x=9,y=16,w=1,h=1,action= switches.add({x=9,y=16,w=1,h=1,action=
@@ -35,6 +35,7 @@ levels["repro"]={
switches.add({x=15,y=13,w=1,h=1,action= switches.add({x=15,y=13,w=1,h=1,action=
function() function()
if not objects.collected("moneda") then table.insert(objects.list, "moneda") end
local hero = actors.search(actors.main.name) local hero = actors.search(actors.main.name)
if hero.o=="u" then if hero.o=="u" then
scene.start({ scene.start({
@@ -52,6 +53,9 @@ levels["repro"]={
currante1_action=function() currante1_action=function()
local hero = actors.search(actors.main.name) local hero = actors.search(actors.main.name)
flags.apuntes=1
if not flags.apuntes then
scene.start({ scene.start({
function() balloon.show("BON DIA!",12,"currante1",false,{x=6,w=7,h=1}) end, function() balloon.show("BON DIA!",12,"currante1",false,{x=6,w=7,h=1}) end,
function() balloon.show("QUINS APUNTES\nNECESSITES?",12,"currante1",false,{x=6,w=8,h=2}) end, function() balloon.show("QUINS APUNTES\nNECESSITES?",12,"currante1",false,{x=6,w=8,h=2}) end,
@@ -59,6 +63,36 @@ levels["repro"]={
function() balloon.show("POS MAL ANEM...",12,"currante1",false,{x=5,w=10,h=1}) end, function() balloon.show("POS MAL ANEM...",12,"currante1",false,{x=5,w=10,h=1}) end,
function() balloon.show("TORNA QUAN SAPIGUES\nEL QUE VOLS",12,"currante1",false,{x=4,w=12,h=2}) end, function() balloon.show("TORNA QUAN SAPIGUES\nEL QUE VOLS",12,"currante1",false,{x=4,w=12,h=2}) end,
}) })
else
if not objects.collected("moneda") then
scene.start({
function() balloon.show("BON DIA!",12,"currante1",false,{x=6,w=7,h=1}) end,
function() balloon.show("QUINS APUNTES\nNECESSITES?",12,"currante1",false,{x=6,w=8,h=2}) end,
function() balloon.show("VULL ELS DE CMC",2,"jailer",true,{x=5,w=10,h=1}) end,
function() balloon.show("PERFECTE!\nVAL 1 MONEDA!",12,"currante1",false,{x=5,w=9,h=2}) end,
function() balloon.show("MONEDA!?\nNO DUC DINERS!",2,"jailer",true,{x=5,w=9,h=2}) end,
function() balloon.show("HO SENT MOLT, PERO\nSENSE PASTA NO HI HA\nAPUNTES...",12,"currante1",false,{x=3,w=12,h=3}) end,
})
else
scene.start({
function() balloon.show("BON D...\nTU ALTRA VEGADA?",12,"currante1",false,{x=4,w=10,h=2}) end,
function() balloon.show("QUINS APUNTES\nVOLIES?",12,"currante1",false,{x=6,w=8,h=2}) end,
function() balloon.show("ELS DE CMC!",2,"jailer",true,{x=6,w=8,h=1}) end,
function() balloon.show("PERO VALEN\n1 MONEDA...",12,"currante1",false,{x=5,w=8,h=2}) end,
function() balloon.show("ACI TENS!",2,"jailer",true,{x=6,w=7,h=1}) end,
function() objects.leave("moneda") scene.cont() end,
function() balloon.show("PERFECTE!\nDONAM UN SEGON...",12,"currante1",false,{x=3,w=11,h=2}) end,
function() actors.search("currante1").path={pos=0,route='ulluuur'} end,
function() wait.start(1) end,
function() actors.search("currante1").path={pos=0,route='uur'} end,
function() wait.start(1.5) end,
function() balloon.show("AH!\nACÍ ESTÀN",12,"currante1",true,{x=4,w=7,h=2}) end,
function() actors.search("currante1").path={pos=0,route='dddddrrd'} end,
function() balloon.show("ACÍ TENS!\nEL 1015 D'INFORMÀTICA",12,"currante1",false,{x=3,w=13,h=2}) end,
function() objects.collect("apuntes") end,
})
end
end
end, end,
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 788 B

After

Width:  |  Height:  |  Size: 900 B

View File

@@ -10,7 +10,7 @@ objects={
leave=function(name) leave=function(name)
for i,obj in ipairs(objects.list) do for i,obj in ipairs(objects.list) do
if object[obj].name and object[obj].name==name then if obj==name then
table.remove(objects.list,i) table.remove(objects.list,i)
return return
end end
@@ -35,5 +35,7 @@ objects={
object={ object={
diskito_knunk={name="DISQUITO DE KNUNK",x=0,y=0}, diskito_knunk={name="DISQUITO DE KNUNK",x=0,y=0},
diskito_usufondo={name="DISQUITO DE USUFONDO",x=16,y=0} diskito_usufondo={name="DISQUITO DE USUFONDO",x=16,y=0},
moneda={name="MONEDA",x=32,y=0},
apuntes={name="APUNTES",x=48,y=0},
} }

View File

@@ -3,6 +3,7 @@ scene={
pos=0, pos=0,
start=function(script) start=function(script)
if scene.script~=nil then return end
scene.pos=0 scene.pos=0
scene.script=script scene.script=script
scene.cont() scene.cont()