diff --git a/data/actors.lua b/data/actors.lua index 8bcf719..129d4a0 100644 --- a/data/actors.lua +++ b/data/actors.lua @@ -105,6 +105,19 @@ actors={ 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.xdx) then for i=1,actor.x-dx do actor.path.route=actor.path.route.."l" end end + if (actor.ydy) then for i=1,actor.y-dy do actor.path.route=actor.path.route.."u" end end + end, + update=function() if actors.updating then return end actors.updating=true @@ -118,7 +131,6 @@ actors={ v.path=nil game.update() if in_scene then scene.cont() end - v.keys=nil if v.name == actors.main.name then local switch = switches.search(v.x,v.y) if switch then diff --git a/data/game.lua b/data/game.lua index 927a6ba..6f0b25b 100644 --- a/data/game.lua +++ b/data/game.lua @@ -20,8 +20,8 @@ game={ restart=function() flags={} objects.list={} - actors.main={name="jailer",x=14,y=11,o="l",gfx={x=32,y=0},level="arq"} - game.init("arq") + actors.main={name="jailer",x=9,y=14,o="u",gfx={x=32,y=0},level="repro"} + game.init("repro") end, init=function(levelname,f,objs) @@ -49,11 +49,11 @@ game={ show_menu=function() game.pause() - brymode.show(game.resume) - --menu.show({ {"GUARDAR PARTIDA", game.save}, - -- {"CARREGAR PARTIDA", game.load}, - -- {"EIXIR", main_init}, - -- }, game.resume) + --brymode.show(game.resume) + menu.show({ {"GUARDAR PARTIDA", game.save}, + {"CARREGAR PARTIDA", game.load}, + {"EIXIR", main_init}, + }, game.resume) end, save=function()