Use space to jump when you're about to be hit by an obstacle.
Credits to one of my other games, Bootleg internet dino!