You mean you want to throw the balls randomly, but confine them to a certain area?
What code are you using to throw the balls?
You mean you want to throw the balls randomly, but confine them to a certain area?
What code are you using to throw the balls?
Sallet I use GdScript codes
The actual code would be helpful in answering your question.
Sallet codes
Off topic, but I can't resist as this is one of my pet peeves 🙂
https://english.stackexchange.com/questions/20455/is-it-wrong-to-use-the-word-codes-in-a-programming-context#20456
So tops is a node (maybe a Sprite2D or TextureRect) whose Sprite2D children are the balls.
You want to place those balls at random positions within a rectangle defined by xmin=50, ymin=50, xmax=350, ymax=350.
There are also constraints such as vertical_spacing and distance. The posted code doesn't show how some of the variables are initialized, such as current_row, new_location, current_top.location.
How is the code failing?
If you could upload a complete, minimal project that uses that code, we could test it.
© 2022 - 2024 — McMap. All rights reserved.