Refactored player movement to work with isKeyPressed