I'm trying to make a card game where the cards fan out. Right now to display it Im using the Allegro API which has a function:
al_draw_rotated_bitmap(OBJECT_TO_ROTATE,CENTER_X,CENTER_Y,X
,Y,DEGREES_TO_ROTATE_IN_RADIANS);
so with this I can make my fan effect easily. The problem is then knowing which card is under the mouse. To do this I thought of doing a polygon collision test. I'm just not sure how to rotate the 4 points on the card to make up the polygon. I basically need to do the same operation as Allegro.
for example, the 4 points of the card are:
card.x
card.y
card.x + card.width
card.y + card.height
I would need a function like:
POINT rotate_point(float cx,float cy,float angle,POINT p)
{
}
Thanks