Updating the player movement logic.