- WIP: Treballant en el menu del joc i els objectes
This commit is contained in:
@@ -7,7 +7,8 @@ editor={
|
|||||||
|
|
||||||
init=function()
|
init=function()
|
||||||
set_update(editor.update)
|
set_update(editor.update)
|
||||||
editor.show_menu()
|
--editor.show_menu()
|
||||||
|
editor.new()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
show_menu=function()
|
show_menu=function()
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ game={
|
|||||||
fade.fadein()
|
fade.fadein()
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
show_menu=function()
|
||||||
|
menu.show({ {"GUARDAR PARTIDA", editor.new},
|
||||||
|
{"CARREGAR PARTIDA", function() textbox.show("FILENAME TO LOAD:",editor.load, mapa.name) end},
|
||||||
|
{"EIXIR", function() if mapa.name~=nil then editor.save(mapa.name) else textbox.show("FILENAME TO SAVE:",editor.save, mapa.name) end end},
|
||||||
|
{"EXIT", main_init},
|
||||||
|
}, function()editor.paused=false end)
|
||||||
|
end,
|
||||||
|
|
||||||
update=function()
|
update=function()
|
||||||
local hero = actors.search("jailer")
|
local hero = actors.search("jailer")
|
||||||
if hero then
|
if hero then
|
||||||
@@ -56,6 +64,8 @@ game={
|
|||||||
hero.path={pos=0,route='l',keys=true}
|
hero.path={pos=0,route='l',keys=true}
|
||||||
elseif btn(KEY_RIGHT) then
|
elseif btn(KEY_RIGHT) then
|
||||||
hero.path={pos=0,route='r',keys=true}
|
hero.path={pos=0,route='r',keys=true}
|
||||||
|
elseif btnp(KEY_ESCAPE) then
|
||||||
|
game.show_menu()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ function _init()
|
|||||||
setsource(tiles)
|
setsource(tiles)
|
||||||
local pal=loadpal("tiles.gif")
|
local pal=loadpal("tiles.gif")
|
||||||
setpal(pal)
|
setpal(pal)
|
||||||
beat(6)
|
beat(12)
|
||||||
fade.init()
|
fade.init()
|
||||||
main_init()
|
main_init()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,10 +13,11 @@ menu = {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
update=function()
|
update=function()
|
||||||
menu.old_update()
|
--menu.old_update()
|
||||||
|
|
||||||
rectfill(10,20, 150, 34+#menu.options*10,6)
|
rectfill(10,20, 150, 34+#menu.options*10,6)
|
||||||
rect(10,20, 150, 34+#menu.options*10,8)
|
rect(10,20, 150, 34+#menu.options*10,8)
|
||||||
|
rect(9,19, 151, 35+#menu.options*10,6)
|
||||||
|
|
||||||
for i,v in ipairs(menu.options) do
|
for i,v in ipairs(menu.options) do
|
||||||
color(4) if menu.selected==i then color(15) prnt(">",20,20+i*10) end
|
color(4) if menu.selected==i then color(15) prnt(">",20,20+i*10) end
|
||||||
|
|||||||
BIN
data/objects.gif
Normal file
BIN
data/objects.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 700 B |
Reference in New Issue
Block a user