refactored camera and player moves into one function