like nx and ny then check the collisions on those values then if it will hit, try going as far as you can without hitting it for jumping..