I'm trying to make smooth following camera using this algorithm:
camera.position.add((pos.x - camera.position.x) * 1.2f * deltaTime, (pos.y - camera.position.y) * 1.2f * deltaTime, 0);
It works fine(camera movements are smooth), but when I move the player appears this artifacts:
Player move() function:
moveX(SPEED * deltaTime);
protected void moveX (float amount) {
float newX = pos.x + amount;
if (!map.doesRectCollideWithMap(newX, pos.y, getWidth(), getHeight()))
pos.x = newX;
}