It took me a couple of monthes to sort this one and make it accurate.
The problem was "Stopping the sprite at each end" So I could run the "Turn around animation" without it sliding.
And the other was getting it to continue, once it had done one run.
I did use Code monkey's sugestion, with "Collision" by putting a hidden wall sprite at each end and through trial and error over six Weeks, it is finaly done.
I now have a precious piece of code to use for other purposes.
This was done for DBC
Sprites are in .JPG format. Convert to BMP. Before using.
If I've made a mess of getting the Graphics to you, Sorry O.W.
OldWrinkly