diff --git a/data/editor.lua b/data/editor.lua index a025770..253c5c6 100644 --- a/data/editor.lua +++ b/data/editor.lua @@ -19,7 +19,7 @@ editor={ menu.show({ {"NEW MAP", editor.new}, {"LOAD MAP", function() textbox.show("FILENAME TO LOAD:",editor.load, mapa.name) end}, {"SAVE MAP", function() if mapa.name~=nil then editor.save(mapa.name) else textbox.show("FILENAME TO SAVE:",editor.save, mapa.name) end end}, - {mapa.front_layer and "DISABLE FRONT LAYER" or "ENABLE FRONT LAYER", editor.toggle_front_layer}, + {editor.editing_front_layer and "DISABLE FRONT LAYER" or "ENABLE FRONT LAYER", editor.toggle_front_layer}, {"RESIZE MAP", editor.resize}, {"RELOAD TEXTURES", editor.reload_textures}, {"EXIT", main_init}, @@ -40,17 +40,23 @@ editor={ end, toggle_front_layer=function() - if not mapa.front_layer then - mapa.front_layer=newsurf(mapa.w,mapa.h) - editor.editing_front_layer=true - setmap(mapa.front_layer) - for y=0,mapa.h-1 do - for x=0,mapa.w-1 do - mset(x,y,0) - end - end + if editor.editing_front_layer then + setmap(mapa.surface) + editor.editing_front_layer=false; else - mapa.front_layer=nil + if not mapa.front_layer then + mapa.front_layer=newsurf(mapa.w,mapa.h) + editor.editing_front_layer=true + setmap(mapa.front_layer) + for y=0,mapa.h-1 do + for x=0,mapa.w-1 do + mset(x,y,0) + end + end + else + editor.editing_front_layer=true + setmap(mapa.front_layer) + end end editor.paused=false end, diff --git a/data/game.lua b/data/game.lua index 42b266f..b3e3ce6 100644 --- a/data/game.lua +++ b/data/game.lua @@ -22,8 +22,8 @@ game={ restart=function() flags={} objects.list={} - actors.main={name="jailer",x=9,y=14,o="u",gfx={x=32,y=0},level="repro"} - game.init("repro") + actors.main={name="jailer",x=6,y=30,o="u",gfx={x=32,y=0},level="vella"} + game.init("vella") end, init=function(levelname,f,objs) diff --git a/data/mapa.lua b/data/mapa.lua index a5acb9d..837308a 100644 --- a/data/mapa.lua +++ b/data/mapa.lua @@ -15,6 +15,7 @@ mapa={ mset(x,y,0) end end + mapa.front_layer=nil end, load = function(filename)