diff --git a/data/editor.lua b/data/editor.lua index cee987a..9ad7829 100644 --- a/data/editor.lua +++ b/data/editor.lua @@ -58,6 +58,35 @@ editor={ end end, + displace=function(dx,dy) + local w,h=mapa.w,mapa.h + if dx>0 then + for y=0,h-1 do + for x=w-1,1,-1 do + mset(x,y,mget(x-1,y)) + end + end + elseif dx<0 then + for y=0,h-1 do + for x=0,w-2 do + mset(x,y,mget(x+1,y)) + end + end + elseif dy>0 then + for y=h-1,1,-1 do + for x=0,w-1 do + mset(x,y,mget(x,y-1)) + end + end + elseif dy<0 then + for y=0,h-2 do + for x=0,w-1 do + mset(x,y,mget(x,y+1)) + end + end + end + end, + update=function() cls() camera(editor.cam.x, editor.cam.y) @@ -74,7 +103,12 @@ editor={ rect(rx1-1, ry1-1, rx2+8, ry2+8, 8) end camera(0,0) - + if tx>=0 and + ty>=0 and + tx