If it is single screen game, just add sprites that cover edges of the screen (outside view, if you want), then in the movement code check for collision with the player only.
Alternatively, you can alter movement to only be able to move within limits ( 0<x<DisplayWidth, 0<y<DisplayHeight) for the player only.