Actually I thought of that, not so long and complex though. Originally, I thought it would be cool to make the player lose if the ship went off the screen, the problem with stopping the movement is that once the movement is stopped, it would cause problems with moving the ship back on the screen.