Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

How do you animate polygons without ghosting?

+4 votes
For the OwlRacing, I am trying to take a polygon and move it.  It works, but it also ghosts and leaves outlines as it passes across the screen.  Is there anyway to eliminate these outlines?
asked Jan 25, 2015 in (Winter 14) by Andy Smith (100 points)

2 Answers

+2 votes
Best answer
I did not have this error. Are you using a panel.clear; command or panel.sleep(50); by chance? More information or a detailed code would be needed.
answered Jan 25, 2015 by Greg Larson (100 points)
selected Jan 26, 2015 by Andy Smith
I figured out what I was doing wrong.  I was sleeping before the clear, and somehow that was leaving the ghosting.  After switching the order, the problem cleared up.  Thanks for the help!
+2 votes
This behavior isn't specific to Polygons -- any shape you draw/fill will leave remnants behind... because you're just painting on top of what is already there.  Like Greg suggested, unless you *clear* the panel (or paint over the old polygon with the background color), you will still see what was there before.
answered Jan 25, 2015 by Forrest Stonedahl (100 points)