Flipping sprites based on their direction