Updated update loop to consider camera movement