We propose in this paper a motion planning method for legged robot locomotion based on Geometric Heat Flow framework. The motion planning task is challenging due to the hybrid nature of dynamics and contact constraints. We encode the hybrid dynamics and constraints into Riemannian inner product, and this inner product is defined so that short curves correspond to admissible motions for the system. We rely on the affine geometric heat flow to deform an arbitrary path connecting the desired initial and final states to this admissible motion. The method is able to automatically find the trajectory of robots center of mass, feet contact positions and forces on uneven terrain.