When making a game, many problems come from collisions of objects. Most of games use simple bounding boxes, but they are not useful in all situations.
Well, what I'm showing here are not pixel-perfect colliders, but still they are pretty useful. To standard bounding box I added a circular collision, but this would be too simple. So I made the boxes rotating.
I based on this: http://www.gamedev.net/page/resources/_/technical/game-programming/2d-rotated-rectangle-collision-r2604
And this: http://www.migapro.com/circle-and-rotated-rectangle-collision-detection/
So our rectangles and circles can now collide with themselves upon any angle. They are just helper classes to attach to object and then check if they intersect.
The code is here: http://pastebin.com/Yxu9NTEy
Just copy it to your project and use the classes.
Example is attached to post.
method of Collision_Box
takes x, y, width, height and angle of box in degrees
takes x,y and radius
Both classes provide methods called
for setting position of collider and
which moves collider (well, rather useless one)
And of course, to check collision, you use
method passing another collider as argument.
I forgot to mention that boxes can be rotated only around center.
Added Collision_Group. Shapes in Collision_Group move relatively to group and any of them triggers collision of whole group.
Now all objects from group rotate around group origin.