Some quadrupeds have evolved the ability of pronking, which consists in leaping by extending the four limbs simultaneously. Pronking is typically observed in some ungulate species inhabiting grassland populated by obstacles such as shrubs, rocks and fallen branches scattered across the environment. Several possible explanations have been proposed for this peculiar behaviour, including the honest signalling of the fitness of the individual to predators or the transmission of a warning alert to conspecifics, but so far none of them has been advocated as conclusive. In this work, we investigate the kinematics of pronking on a two-dimensional landscape populated by randomly scattered obstacles. We show that when the density of obstacles is larger than a critical threshold, pronking becomes the gait that maximizes the probability of trespassing in the shortest possible time all the obstacles distributed across the distance fled, and thus represents an effective escape strategy based on a simple open-loop control. The transition between pronking and more conventional gaits such as trotting and galloping occurs at a threshold obstacle density and is continuous for a non-increasing monotone distribution of the height of obstacles, and discrete when the distribution is peaked at a non-zero height. We discuss the implications of our results for the autonomous robotic exploration on unstructured terrain.