Is there a way to detect how much of the screen is occupied by objects? for example, 50%?
Like in this game:
I keep thinking about this, but this surpasses my knowledge.
Develop games in your browser. Powerful, performant & highly capable.
As long as circles don't overlap:
variable 1 = height of your play area / width of your play area
variable 2 = occupied area, starts at 0
when you create a new circle: add pi*r^2 to variable 2
or via bruteforce, gridbased
2x2 sprite; then scan the whole play area with it by moving it along it step by step and checking for overlaps with the relevant object/family; if it overlaps, add 4 (= 2*2) to variable 2, performance will be really bad though
Thanks! It was super easy! I never thought about area :) Basic math