What about if you use the player's x, y, and screenwidth to determine the x and y of the bounds of the current 'viewport'
ie. player's coords are (30,30), screenwidth is 1024, 30*16=480, the left bound should be playerx - 480 (give or take 16), and + 480 (or so) for the right hand bound. This could be locally run in a loop i think, though I am new to this language so I am not sure of it's loop/speed capabilities yet.
idk.. just an idea, hope you caught what I mean
