Is there a way to check if a sprite will collide with another sprite before they do?
I'm having a flickering issue where when you tap a square, it's meant to randomly appear else where on the screen without colliding with any other object within the array.
The squares move but you can notice that when one collides it quickly reappears somewhere else.
Is there a method i'm missing or am I doing it wrong?
if GetSpriteCollision( SpriteArray[0], SpriteArray[1] ) = 1 or GetSpriteCollision( SpriteArray[0], SpriteArray[2] ) = 1 or GetSpriteCollision( SpriteArray[0], SpriteArray[3] ) = 1 or GetSpriteCollision( SpriteArray[0], SpriteArray[4] ) = 1
SetSpritePositionByOffset( SpriteArray[0], Random( 150, GetDeviceWidth()-150 ), Random( 100, GetDeviceHeight()-100 ) )
SetSpriteVisible(SpriteArray[0], 0)
else
SetSpriteVisible(SpriteArray[0], 1)
endif
if GetSpriteCollision( SpriteArray[1], SpriteArray[2] ) = 1 or GetSpriteCollision( SpriteArray[1], SpriteArray[3] ) = 1 or GetSpriteCollision( SpriteArray[1], SpriteArray[4] ) = 1
SetSpritePositionByOffset( SpriteArray[1], Random( 150, GetDeviceWidth()-150 ), Random( 100, GetDeviceHeight()-100 ) )
SetSpriteVisible(SpriteArray[1], 0)
else
SetSpriteVisible(SpriteArray[1], 1)
endif
if GetSpriteCollision( SpriteArray[2], SpriteArray[3] ) = 1 or GetSpriteCollision( SpriteArray[2], SpriteArray[4] ) = 1
SetSpritePositionByOffset( SpriteArray[2], Random( 150, GetDeviceWidth()-150 ), Random( 100, GetDeviceHeight()-100 ) )
SetSpriteVisible(SpriteArray[2], 0)
else
SetSpriteVisible(SpriteArray[2], 1)
endif
if GetSpriteCollision( SpriteArray[3], SpriteArray[4] ) = 1
SetSpritePositionByOffset( SpriteArray[3], Random( 150, GetDeviceWidth()-150 ), Random( 100, GetDeviceHeight()-100 ) )
SetSpriteVisible(SpriteArray[3], 0)
else
SetSpriteVisible(SpriteArray[3], 1)
endif
Don't mind the mess, I'm just testing things
Cheers