This code snippet is from one of my projects using C++ and SFML. Given two Rectangle objects, the function swaps the height of the two objects, adjust the y-coordinates according to the ground value, changes the color of the rectangles to white, and has a delay at then end to make the animation smooth. However as I only have one comment above the function I thought the function requires better documentation of what the function does.
This code snippet is from one of my projects using C++ and SFML. Given two Rectangle objects, the function swaps the height of the two objects, adjust the y-coordinates according to the ground value, changes the color of the rectangles to white, and has a delay at then end to make the animation smooth. However as I only have one comment above the function I thought the function requires better documentation of what the function does.