In my game you control the player with the mouse. You can only move left and right and shoot.

So I have code like this:

Player.y = 400

Every tick: Player.x = mouse.x

But what a lot of my play testers do in their enthusiasm is move the mouse to far, and thus get out of the layout. When this happens you can no longer shoot or move, witch most of the time lead to death.