I read many variants today and get some knowledge in general, so here is a steps of mine thoughts in pictures (horrible paint.net ones)
We.
We need to develop grid system, so we check only thing near, perform simple check to cut out deep check, and at - last deep check like per-pixel collision check.
Step 1 - let p1Let
p1, p2p2are some sprites let atlets first just check with circle collision - because large distance between p1p1, p2p2this failfails and of course so we don't need test more deeply. But if we have not 2, but 20 objects, why we need to even circle test something so far outside of our view.Step 2 - addAdd basic column system, now we don't bother with p2 it
p2if it's in a column which differ much of p1 colfar fromp1column, so we even don't do circle test. But p3p3is in the same col, so let do circle test, which of course will fail.Step 3 - letsLets improve colcolumn system to the grid system with grid cell size just like p1
p1, p2p2, p3p3collision boxes, so we cut out things much top or below p1p1. And this is all great until comes BIG OBJs which is some kind of platforms. They are much bigger then grid cell.


Circle test for will be successful, but deep check for whole big obj will fail
And that the part iI can't get.
How do I store the grid position of big object? Like 4 grid coords for big object vertexes? And if one of them close to p1p1 do circle check for centre of big object then a deep one if succeed? Am iI do it wrong?
my possible solution - again sorry for links to pictures.
My possible solution:
