Sonic drops a probe from each foot. The smaller gap - the foot on the higher ground - decides where he stands, and its block's angle decides which drawn frame is used.