Bananas are laid out in a way that charts a safe path through obstacles. As long as you're grabbing bananas, you're safe. So by design, this should come naturally over time since you will need to get good at dodging obstacles, and there's no better way to do it than following the bananas.