Any idea about how to make this effect?

Game is

Effect is: like the ball with tail can change the direction how to make it?