Make sure that all of the variables involved (player, px, py) are either Global or passed to the function.
Your code posted looks OK. What's the point of printing "SO"?
Try Debug mode and putting a Stop in your ImagesCollide If routine. Then check the variable values at the moment the collision occurs. This may let you on to what is happening.
Your code posted looks OK. What's the point of printing "SO"?
Try Debug mode and putting a Stop in your ImagesCollide If routine. Then check the variable values at the moment the collision occurs. This may let you on to what is happening.