add camera movement to render
This commit is contained in:
@@ -384,10 +384,13 @@ local function render(buf, pbuf, cx,cy,cz, tx,tz, sx,sz, shouldsetlist,invertsli
|
||||
1,
|
||||
}
|
||||
|
||||
local tsx,tsy = term.getSize()
|
||||
local camx,camy = cx+tsx/2,cz+tsy/2
|
||||
|
||||
reset()
|
||||
for x=1,sx,1 do
|
||||
for z=1,sz,1 do
|
||||
local currentbuf = pbuf[posasstring(x, cy, z)]
|
||||
for x=1+camx,sx+camx,1 do
|
||||
for z=1+camy,sz+camy,1 do
|
||||
local currentbuf = pbuf[posasstring(x-camx, cy, z-camy)]
|
||||
term.setCursorPos(x, z)
|
||||
if currentbuf then -- wall
|
||||
term.blit(" ", colors.toBlit(colors.white), colors.toBlit(colors.white))
|
||||
|
||||
Reference in New Issue
Block a user