Implemented sprite flipping.