I have a circle that I’d like to automatically fill with boxes of sizes 10x10 and 20x20. There should be no gaps between the boxes, except ofcourse at the circle’s edges.
I made an experiment where:
- I designed small grey „placeholder“ squares (10x10px) with random numbers between 1-10 and a value to detect a collision.
- I also have bigger squares (Green, 20x20px) with a number value of 5.
- When the small square’s random number is over 5, the bigger square is placed on it, detecting the collision.
- Ideally, the bigger square should collide with four small squares a, but it’s only doing that to the top-left one.
- This is causing some bigger squares to overlap, and I’m unsure how to fix it.