For instance:
c = getFirstContact()
while c > 0
s1 = getContactSpriteID1()
s2 = getContactSpriteID2()
if s1 <> player.sprite and s2 <> player.sprite then playSound(_snd_Hit1)
if s1 = player.sprite or s2 = player.sprite then playSound(_snd_Shock)
c = getNextContact()
endwhile
I'll play a sound if two objects collide, or a different sound if one of the objects is the player.
But, as long as I'm pressing left or right arrow key to control player's rotation:
if getRawKeyState(37) = 1 then setSpriteAngle(player.sprite, getSpriteAngle(player.sprite)-2)
if getRawKeyState(39) = 1 then setSpriteAngle(player.sprite, getSpriteAngle(player.sprite)+2)
A contact with the player sprite is never returned. The collision still happens as you can see the response on screen when the game is running, but it doesn't get picked up with the contact commands. Same thing happens if I try using
getPhysicsCollision and looping through all the objects with the player sprite.
I need to be able to check this, not just to match up sounds but so I can control the player's life accordingly