There are a couple ways to do this.
One is to take the locations of the points of the collision polygon and calculating the point of collision and angle of the surface in contact by using the Separating Axis Theorem. It's a bit more technical to do but it gives exact results:
Another simpler way is to check for collisions around an object and averaging out the offsets to get a angle. Here's one that does that when one object is a ball:
Sadly my collision polygons will effectively be a smoothed shape, comprising of approx 8 points.
I've attached an example of my current method. Hopefully this isn't too taxing for the cpu. The object shoots a bullet that detects the angle of the surface and feeds it into the angle of the main sprite.
However, the problem is now that when the object deflects off at (let's say) a 90 degree angle, the main sprite sets itself to 90 degrees where I'd want it to set itself to 45 degrees.
https://onedrive.live.com/redir?resid=FB21E2766119D2EA!76224&authkey=!AHhzj8Ufzmfbm3c&ithint=file%2ccapx
It's just a quick and dirty way of determining a surface angle... and apparently not a very good one.
Might you know of a way to improve on this method?