In the left image, the water is visible through the sprite. In the right image, it is not. I want the sprite to be like it is in the right image: you can't see the sea through the sprite.
(of course, the sprite has to be transparent)

It is 'normally' transparent in the middle rows of the terrain (so the rows that are closest to the camera).
It is 'sea' transparent in the outer rows (furthest from the camera)