# sprite rotation

## Recommended Posts

Hello there! This is my first post and  hope I'm not writing to wrong section.

Anyways, I'm writing some board game, which uses cards (e.g Hearthstone).

I'll be honest that I'm not that good in Math (I know, you would ask then why I'm doing it. Well, just to learn).

I'm using simple cards, but I would like to place it like in Hearthstone (like a "fan")

Here's the sample:

Cards at bottom are aligned with rotation and not straight.

Can anyone give me a point or formula how can I solve that?

Also forgive my English skills as well. If you don't understood anything, let me know!

Regards

##### Share on other sites

You could use the circle equations:

Those will help you position the cards but you'll also need to orient them so that they are at the right angle.
You can use the Math.atan2() function for that.

##### Share on other sites

I'm drawing cards with simple function like:

`for (var i = 0; i < 5; i++){    var card = game.sprite.add(..);}`

but as I mentioned in above post, I'm not that good in Math, I know only basics. Can you please provide more details if you don't mind?

Regards!