How can I achieve a direction change like in the game curvulate? The character moves left to right, when a star is collected?