draw_grid = function() love.graphics.setColor(0.8, 0.8, 0.8) local xlo, xhi = sx(0), sx(Viewport.w) local ylo, yhi = sy(0), sy(Viewport.h) local base = base_for_zoom(100) xlo, xhi = floor_to(xlo, base), floor_to(xhi, base)+base ylo, yhi = floor_to(ylo, base), floor_to(yhi, base)+base for x = xlo, xhi, base do love.graphics.line(vx(x), 0, vx(x), Viewport.h) end for y = ylo, yhi, base do love.graphics.line(0, vy(y), Viewport.w, vy(y)) end end