debug player and refactor scaling and origin logic to their own functions
debugging, please rewrite