Adds collision detection against edge of screen.