- [NEW] logica de game.restart() i game.startfromeditor() concretada
- [NEW] game.startfromeditor() ara també especifica la orientació - [FIX] Previndre acces al menu durant els fades - [FIX] Al carregar partida, abortar sequencia si hi havia una en execució - [FIX] Els flags es carregaven com a strings en compte de números - [FIX] Al carregar partida no se movia al heroi al nivell que tocaba - [NEW] Acabada seqüència del bocata de sobrasada pata - [NEW] Gràfics i objecte del bocata de sobrasada pata
This commit is contained in:
@@ -40,7 +40,7 @@ editor={
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
playfromhere=function()
|
playfromhere=function()
|
||||||
game.startfromeditor(string.sub(mapa.name,1,-5), editor.cx, editor.cy)
|
game.startfromeditor(string.sub(mapa.name,1,-5), editor.cx, editor.cy, "d")
|
||||||
end,
|
end,
|
||||||
|
|
||||||
reload_textures=function()
|
reload_textures=function()
|
||||||
|
|||||||
@@ -22,26 +22,23 @@ game={
|
|||||||
cam={x=0,y=0},
|
cam={x=0,y=0},
|
||||||
|
|
||||||
restart=function()
|
restart=function()
|
||||||
flags={}
|
--flags={}
|
||||||
objects.list={}
|
--objects.list={}
|
||||||
--actors.main={name="jailer",x=43,y=25,o="u",gfx={x=32,y=0},level="vella"}
|
--actors.main={name="jailer",x=12,y=12,o="r",jailmoji="AHDJONAAAAFAACFBBO",level="arq"}
|
||||||
--game.init("vella")
|
--game.init("arq")
|
||||||
actors.main={name="jailer",x=12,y=12,o="r",jailmoji="AHDJONAAAAFAACFBBO",level="arq"}
|
game.startfromeditor("arq",12,12,"r")
|
||||||
game.init("arq")
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
startfromeditor=function(s_level, s_x, s_y)
|
startfromeditor=function(s_level, s_x, s_y, s_o)
|
||||||
print("Playing level: "..s_level.." at pos "..s_x..","..s_y)
|
print("Playing level: "..s_level.." at pos "..s_x..","..s_y)
|
||||||
flags={}
|
flags={}
|
||||||
objects.list={}
|
objects.list={}
|
||||||
actors.main={name="jailer",x=s_x,y=s_y,o="d",jailmoji="AHDJONAAAAFAACFBBO",level=s_level}
|
actors.main={name="jailer",x=s_x,y=s_y,o=s_o,jailmoji="AHDJONAAAAFAACFBBO",level=s_level}
|
||||||
game.init(s_level)
|
game.init(s_level)
|
||||||
--actors.main={name="jailer",x=8,y=12,o="l",gfx={x=32,y=0},level="arq"}
|
|
||||||
--game.init("arq")
|
|
||||||
end,
|
end,
|
||||||
|
|
||||||
init=function(levelname,f,objs)
|
init=function(levelname,f,objs)
|
||||||
|
scene.abort()
|
||||||
if f then flags=f end
|
if f then flags=f end
|
||||||
if objs then objects.list=objs end
|
if objs then objects.list=objs end
|
||||||
|
|
||||||
@@ -125,7 +122,7 @@ game={
|
|||||||
local line = io.read()
|
local line = io.read()
|
||||||
while line ~= "[OBJECTS]" do
|
while line ~= "[OBJECTS]" do
|
||||||
local k,v=getkeyval(line)
|
local k,v=getkeyval(line)
|
||||||
new_flags[k]=v
|
new_flags[k]=tonumber(v)
|
||||||
line = io.read()
|
line = io.read()
|
||||||
end
|
end
|
||||||
line = io.read()
|
line = io.read()
|
||||||
@@ -134,6 +131,7 @@ game={
|
|||||||
line = io.read()
|
line = io.read()
|
||||||
end
|
end
|
||||||
io.close(file)
|
io.close(file)
|
||||||
|
actors.main.level=level_name
|
||||||
end
|
end
|
||||||
fade.fadeout()
|
fade.fadeout()
|
||||||
--game.resume()
|
--game.resume()
|
||||||
@@ -210,7 +208,7 @@ game={
|
|||||||
actors.interact(hero.x,hero.y,hero.o)
|
actors.interact(hero.x,hero.y,hero.o)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if key.press(key.ESCAPE) then
|
if key.press(key.ESCAPE) and update==game.update then
|
||||||
game.show_menu()
|
game.show_menu()
|
||||||
elseif key.press(key.TAB) then
|
elseif key.press(key.TAB) then
|
||||||
game.show_debug_menu()
|
game.show_debug_menu()
|
||||||
|
|||||||
@@ -36,7 +36,10 @@ levels["vella"]={
|
|||||||
actors.add({name="alumne_cua2",x=26,y=26,o="d",gfx={x=0,y=80}})
|
actors.add({name="alumne_cua2",x=26,y=26,o="d",gfx={x=0,y=80}})
|
||||||
actors.add({name="alumne_cua3",x=26,y=27,o="d",gfx={x=0,y=64}})
|
actors.add({name="alumne_cua3",x=26,y=27,o="d",gfx={x=0,y=64}})
|
||||||
|
|
||||||
actors.add({name="imbesil",x=27,y=23,o="r",jailmoji="AEFJNJAAAAEBFFIAAB"})
|
if flags.caixer_visitat~=2 then
|
||||||
|
actors.add({name="imbesil",x=27,y=23,o="r",jailmoji="AEFJNJAAAAEBFFIAAB"})
|
||||||
|
actors.add({name="bocata",x=29,y=23,o="d",gfx={x=160,y=80},action=levels.vella.bocata_action})
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ levels["vella"]={
|
|||||||
switches.add({x=28,y=24,w=1,h=1,action=
|
switches.add({x=28,y=24,w=1,h=1,action=
|
||||||
function()
|
function()
|
||||||
local hero = actors.search(actors.main.name)
|
local hero = actors.search(actors.main.name)
|
||||||
--if flags.caixer_visitat==1 then
|
if flags.caixer_visitat==1 then
|
||||||
flags.caixer_visitat=2
|
flags.caixer_visitat=2
|
||||||
scene.start({
|
scene.start({
|
||||||
function() balloon.show("EH!!!",3,"imbesil",false,{x=5,w=8,h=1}) end,
|
function() balloon.show("EH!!!",3,"imbesil",false,{x=5,w=8,h=1}) end,
|
||||||
@@ -79,9 +82,9 @@ levels["vella"]={
|
|||||||
function() balloon.show("IMBÈSIL...",3,"jailer",false,{x=5,w=8,h=1}) end,
|
function() balloon.show("IMBÈSIL...",3,"jailer",false,{x=5,w=8,h=1}) end,
|
||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
--else
|
else
|
||||||
-- return false
|
return false
|
||||||
--end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -111,4 +114,19 @@ levels["vella"]={
|
|||||||
function() balloon.show("NO VAN ELS COMPS\nESTAN TOTS ACTUALITZANT",2,"jailer",true,{x=1,w=15,h=2}) end
|
function() balloon.show("NO VAN ELS COMPS\nESTAN TOTS ACTUALITZANT",2,"jailer",true,{x=1,w=15,h=2}) end
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
bocata_action=function()
|
||||||
|
--local hero = actors.search(actors.main.name)
|
||||||
|
--if hero.o~="u" and hero.o~="r" then return end
|
||||||
|
if flags.caixer_visitat==2 then
|
||||||
|
scene.start({
|
||||||
|
function() actors.remove("bocata") scene.cont() end,
|
||||||
|
function() objects.collect("bocata") end,
|
||||||
|
})
|
||||||
|
else
|
||||||
|
scene.start({
|
||||||
|
function() balloon.show("NO TE ACERQUES A\nMI BOCATA, MONGOLO",3,"imbesil",false,{x=5,w=12,h=2}) end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
BIN
data/objects.gif
BIN
data/objects.gif
Binary file not shown.
|
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 1.0 KiB |
@@ -40,4 +40,5 @@ object={
|
|||||||
moneda2={name="ALTRA MONEDA",x=32,y=0},
|
moneda2={name="ALTRA MONEDA",x=32,y=0},
|
||||||
apuntes={name="APUNTES",x=48,y=0},
|
apuntes={name="APUNTES",x=48,y=0},
|
||||||
rosquilletes={name="ROSQUILLETES",x=64,y=0},
|
rosquilletes={name="ROSQUILLETES",x=64,y=0},
|
||||||
|
bocata={name="BOCATA SOBRASADA PATA",x=80,y=0},
|
||||||
}
|
}
|
||||||
@@ -18,5 +18,10 @@ scene={
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
scene.script[scene.pos]()
|
scene.script[scene.pos]()
|
||||||
|
end,
|
||||||
|
|
||||||
|
abort=function()
|
||||||
|
scene.script=nil
|
||||||
|
scene.pos=0
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
BIN
data/sprites.gif
BIN
data/sprites.gif
Binary file not shown.
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Reference in New Issue
Block a user