http://www.perlmonks.org?node_id=927763


in reply to "flashing"-like stuff

I think that I am reading your code correctly, if not, then ignore as appropriate.

When you are printing your movement, you are first clearing the old location, then writing to the new location. There is a period of time where the screen does not have the "sprite" displayed. With graphics-based sprites, I believe that the correct solution is to xor at the new location, then xor at the old location. In your text based version, print to the new location first, then clear the old location. There may be some edge cases <update>especially when old and new overlap</update> that you need to consider.

It has been a number of years since I have tackled this problem, but I seem to remember it being a common one when moving blocks of stuff around the screen.

--MidLifeXis