I have a couple of old examples, they spawn object on the entire screen, but you can easily change them to spawn in a line:
https://howtoconstructdemos.com/spawn-objects-randomly-without-overlapping-2-capx/
Your example fixed it. Thank you!
https://i.ibb.co/4Mk7XQY/test.gif