Fill Mask with different Rectangle Sizes

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.

The events are only checking one placeholder while the new block would occupy 4 placeholders. You need to check all 4 placeholder or their locations for another block. Meaning the target placeholder, the one to the right, the one below and the one below and to the right.

I’m on my phone and it would be difficult for me to go into depth. But hopefully it will give you or others a starting point.