You can use two variables, like cx and cy, for the camera offset and these two variables to everything you draw, like spr(0, x+cx, y+cy). You can move the camera by changing these variables.