2 options:
1) reduce the border (experiment a little with the - 100):
game.HorizontalScrollDistance = (game.WindowResolution.x / 2) - 100
game.VerticalScrollDistance = (game.WindowResolution.y / 2) - 100
2) a main loop handler:
function scroll()
local x,y = graphics.getScrollPosition()
local gr = game.WindowResolution
local t = game.CurrentCharacter.Position
t.x = t.x - gr.x / 2
t.y = t.y - gr.y / 2
local r = game.CurrentScene.Sprite:getSize()
t.x = math.max(0, math.min(t.x, r.x - gr.x))
t.y = math.max(0, math.min(t.y, r.y - gr.y))
x = x * 0.9 + t.x * 0.1
y = y * 0.9 + t.y * 0.1
graphics.setScrollPosition(x,y)
end
registerEventHandler("mainLoop","scroll")