im no scriptwriter, but i think that if you make it so that it can only go so far from its spawn point, like say 128 bricks, then all you would have to do it figure out how far that is from the shore and place the spawn there. It would save you from the beaching problem, and the swimming out to sea issue! (win win!)