screen barriers?

Blitz3D Forums/Blitz3D Programming/screen barriers?

hey, im making a birdseye space shooter, i need to make it so you cant leave the camera which i usually do like this.

if entityx(ship)> 10 then positionentity ship,10 . . .

which would work fine except that ive made it so you can dive down. So if the ships X is 10 and the Y is 0 it works, but once you go down the ship isnt at the edge of the screen anymore. What is a fast way to allow it to go to the edge of the camera?