Just to clarify;
You have two objects that will collide with everything else in the world but not with each other? is that right?
If so (You have to wait for it but you will see that the red and green objects do not collide with each other);
rem
rem AGK Application
rem
rem Landscape App
SetWindowSize(1024, 768, 0)
setVirtualResolution(GetWindowWidth() * .5, GetWindowHeight() * .5)
SetVSync(1)
#constant VW GetVirtualWidth()
#constant VH GetVirtualHeight()
rem set physics world up
setPhysicsScale(0.1)
setPhysicsGravity(0,0)
setPhysicsDebugOn()
type dir
x as float
y as float
endtype
b1 as integer
b2 as integer
for i=0 to 10
createBall(VW, VH, 0)
next
b1 = createBall(VW, VH, 20)
b2 = createBall(VW, VH, 20)
SetSpriteColor(b1, 0xff, 0, 0, 0xff)
SetSpriteColor(b2, 0, 0xff, 0, 0xff)
SetSpriteVisible(b1, 1)
SetSpriteVisible(b2, 1)
SetSpriteGroup(b1, -100, 0)
SetSpriteGroup(b2, -100, 0)
SetSpritePhysicsVelocity( b1, random(100, 200), -random(100, 200) )
SetSpritePhysicsVelocity( b2, -random(100, 200), random(100, 200) )
do
// Manage the background
SetSpritePhysicsImpulse(b1, GetSpriteXByOffset(b1), GetSpriteYByOffset(b1), GetSpritePhysicsVelocityX(b1) * .02, GetSpritePhysicsVelocityY(b1) * .02)
SetSpritePhysicsImpulse(b2, GetSpriteXByOffset(b2), GetSpriteYByOffset(b2), GetSpritePhysicsVelocityX(b2) * .02, GetSpritePhysicsVelocityY(b2) * .02)
print("("+str(GetSpriteXByOffset(b1))+","+str(GetSpriteYByOffset(b1)))
print("("+str(GetSpriteXByOffset(b2))+","+str(GetSpriteYByOffset(b2)))
sync()
loop
function createBall(w as float, h as float, r as integer)
x as float
y as float
s as integer
d as float
x = random(10, w - 10)
y = random(10, h - 10)
s = createsprite(0)
if r = 0
d = random(10, 20)
else
d = r
endif
SetSpritePositionByOffset(s, x, y)
SetSpriteSize(s, d, d)
SetSpriteShape( s, 1)
setSpritePhysicsOn(s,2)
setSpriteVisible(s, 0)
SetSpritePhysicsRestitution(s, 01)
SetSpriteGroup(s, 100, 0)
endfunction s