With the latest update the app I am working on now crashes I have traced this to the command SetSpritePhysicsOff after the sprites have collided, below is some code that demonstrate this. This code has worked flawlessly until now.
SetWindowSize(640, 480, 0)
SetVirtualResolution(640, 480)
//Create a Green Cross Image
Drawline(0, 0, 15, 15, 0, 255, 0)
Drawline(0, 15, 15, 0, 0, 255, 0)
GetImage(1, 0, 0, 15, 15)
//Create Sprites From Cross
Global Sprite1
Sprite1 = CreateSprite(1)
SetSpritePosition(Sprite1, 300, 300)
SetSpritePhysicsOn(Sprite1, 1)
Global Sprite2
Sprite2 = CreateSprite(1)
SetSpritePosition(Sprite2, 300, 200)
SetSpritePhysicsOn(Sprite2, 2)
Do
Handle_Collisions()
Sync()
Loop
Function Handle_Collisions()
Is_Contact As Integer
ID1 As Integer
ID2 As Integer
Is_Contact = GetFirstContact()
while Is_Contact
ID1 = GetContactSpriteID1()
ID2 = GetContactSpriteID2()
If ID1 = Sprite1
SetSpritePhysicsOff(Sprite2) //Crash at this point
ElseIf ID2 = Sprite1
SetSpritePhysicsOff(Sprite2)
EndIf
EndWhile
EndFunction
It doesn’t matter if you turn off the physics of sprite 1 or 2 the result is the same, bug or am I doing something wrong?