There are three main robot enemies to look out for in each stage, colored red, yellow and blue. Yellow enemies can't be destroyed, but you can stand on their heads without taking harm. They also provide a boost to higher platforms if you're in a hurry. When it comes to blue robots, jumping on their heads will cost you precious health because of the spikes they have on top. However, you can slide to eliminate them, since they're vulnerable from the sides. As for red robots, avoid them completely. They're covered with spikes.
Sometimes you'll have to swing longer in order to achieve greater distance and collect more coins. Other times, you'll want to stop short, like if you're headed towards a spiked wall.
In race stages, keep a close eye on your ghostly opponents. Sometimes they know the best route to take, which can easily give you a faster completion time.