'how to create a boundary / limit whilst running a simulation - python

Am extremely new to coding so please be gentle!! Was wondering how you would set-up a boundary or a limit. Currently running a lure scatter simulation and if you get to the edge of the screen they disappear or get stuck there. Any help would be awesome.

stuck at the edge



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source