Thanks for the thought unlikely. I've had a go and I think that helps but it does not solve the problem entirely. I've resorted to doing manual checks for overlap and positioning the objects so that they are no longer colliding. To give you an example of what I mean, here is some code:
SetVirtualResolution(800, 800)
dim allBlocks[16, 8] as integer
SetPhysicsDebugOn()
//SetPhysicsGravity(0, 100) // This seems to work fine
SetPhysicsGravity(100, 0) // This seems to cause some overlap
nLeft = CreateSprite(0)
SetSpriteSize(nLeft, 50, 800)
SetSpritePosition(nLeft, -50, 0)
SetSpritePhysicsOn(nLeft, 1)
nRight = CreateSprite(0)
SetSpriteSize(nRight, 50, 800)
SetSpritePosition(nRight, 800, 0)
SetSpritePhysicsOn(nRight, 1)
nBottom = CreateSprite(0)
SetSpriteSize(nBottom, 800, 50)
SetSpritePosition(nBottom, 0, 800)
SetSpritePhysicsOn(nBottom, 1)
for c = 1 to 16
for d = 1 to 8
allBlocks[c, d] = CreateSprite(0)
SetSpriteColor(allBlocks[c, d], Random(0, 255), Random(0, 255), Random(0, 255), 255)
SetSpriteSize(allBlocks[c, d], 50, 50)
SetSpritePosition(allBlocks[c, d], 50 * (c - 1), 800 - (50 * d))
SetSpritePhysicsOn(allBlocks[c, d], 2)
SetSpritePhysicsRestitution(allBlocks[c, d], 0.0)
SetSpritePhysicsIsBullet(allBlocks[c, d], 1)
next d
next c
do
Sync()
loop
end
If you run that, and it runs as it does on my machine, then you will notice some overlap of the blocks to the right of the screen. However if you change the gravity by uncommenting the commented gravity line and commenting out the current one, then you'll notice that it seems to work fine without any overlap. Any idea what is going on here?