I am going to have to do a tutorial over this. Seen it pop up a couple of times recently. I had this exact question a while ago:
Here is a demo of rocks smashing into each other in space using the momentum forumla to figure out relative damage based on velocity and mass: Demo
And here's the capx (r120.2)
. Basically, you want to add each object's x velocity and y velocities together, then add those two results together to get a relative velocity. Since that velocity can be negative, you take the abs of that relative velocity and use it with the mass of the object to get your momentum. After that, you decide how much damage each unit of momentum is worth and wreak havoc.