extract tryToJump into a method, for simplicity