I am currently making a snake game in c++, but have encountered this problem. In order to make my snake, I have been using a vector full of objects of rectangles, and drawing them to where my snake goes. However, I have run into a problem. At first, my snake would be infinite as I would keep drawing more rectangles to put into the vector. However, when I try to clear the vector at the bottom of my program, none of the rectangles get redrawn, and I'm left with a tiny snake on the screen.