Make two private variables (for this sprite only) named last x pos and last y pos. Then add this script:
[blocks]<when green flag clicked>
<forever>
<set{ last x pos }to( <x position>
<set{ last y pos }to( <y position>
<if><touching[ wall sprite
<go to x <{ last x pos }> )y
<{ last y pos }>
<end>
<end>[/blocks]
Offline