Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("buffpixel")
- local w, h = term.getSize()
- term.clear()
- local win_width, win_height, win_x, win_y = 20,10,5,3
- paintutils.drawBox(win_x, win_y, win_x+win_width+1, win_y+win_height+1, colors.gray)
- buff = buffpixel.new(w*4,h*4,0, 0 , win_width, win_height )
- paintutils.drawBox(win_x+22, win_y, win_x+win_width+23, win_y+win_height+1, colors.gray)
- buff2 = buffpixel.new(w*4,h*4,0, 0 , win_width, win_height )
- local pix = buff.newPixel
- buff:setRenderOffset(win_x,win_y)
- buff2:setRenderOffset(win_x+22,win_y)
- local rw, rh = math.ceil(w/2), math.ceil(h/2)
- buff:fillMap(pix("5D","*",false))
- buff2:fillMap(pix("5D"," ",false))
- buff:setPixel(w-1,10,pix("87","@",true))
- buff:newPlayer("BG","&",win_width/2,win_height/2,keys.w,keys.s,keys.a,keys.d,keys.e,1)
- buff2:newPlayer("BG","@",win_width/2,win_height/2,keys.up,keys.down,keys.left,keys.right,keys.e,1)
- buff:render()
- buff2:render()
- buff:drawPlayer()
- buff2:drawPlayer()
- while true do
- local e = { os.pullEvent() }
- buff:getMousePlaceBlock(e,pix("87","@",true),pix("5D","*",false))
- buff2:getMousePlaceBlock(e,pix("87"," ",true),pix("5D"," ",false))
- buff:updatePlayer(e,0)
- buff2:updatePlayer(e,0)
- local px, py = buff:getPlayerPos()
- local pox, poy = buff:getOutsideViews(px,py,1,1)
- buff:lerpView(pox,poy,win_width/2,win_height/2,0)
- local px, py = buff2:getPlayerPos()
- local pox, poy = buff2:getOutsideViews(px,py,1,1)
- buff2:lerpView(pox,poy,win_width/2,win_height/2,0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement